2
  1. I have a Java application where I am using PooledExecuter from oswego.
  2. I strongly suspect that there is a thread contention in my application as irrespective of using PooledExecuter, requests are taking time = roughly no of requests * time for one request.
  3. I want to gather evidence that there is definitely a thread contention.
  4. Is there any way I can set some JVM parameters which show me what different threads are doing or any other way that can be useful to detect thread contention.
4

2 に答える 2

2

あなたの説明から、シングルスレッドのリソースがあり、コードが複数のスレッドを効率的に使用できないようです。これが発生している間に (数回) スレッド ダンプを取得することで、これを確認できるはずです。1 つのスレッドが「実際の」作業を行っており、プール内の他のすべてのスレッドが何かを待っているか、アイドル状態になっていることがわかります。

于 2012-04-19T12:58:44.360 に答える
1

これを伝えることができるjvmオプションを知りません。プロファイラーをそれに接続し、スレッドが競合している(ブロックされている/待機している)かどうかを確認し、競合しているロックを確認します。

于 2012-04-19T12:54:00.237 に答える