TomcatでJava EEベースのアプリケーションを実行していて、数時間実行した後にアプリケーションが突然停止することがあります。 Javaプロセスのスレッドダンプの分析
は、私はそれがハングアップする直前にアプリケーションからのスレッドダンプを収集し、分析のためにTDAにそれを置く:TDA(スレッドアナライザをダンプ)上記のモニターのための次のようなメッセージを与える:
A lot of threads are waiting for this monitor to become available again.
This might indicate a congestion. You also should analyze other locks
blocked by threads waiting for this monitor as there might be much more
threads waiting for it.
そして、ここでは、スレッドのスタックトレースは、上記の強調表示されています:
"MY_THREAD" prio=10 tid=0x00007f97f1918800 nid=0x776a
waiting for monitor entry [0x00007f9819560000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.util.Hashtable.get(Hashtable.java:356)
- locked <0x0000000680038b68> (a java.util.Properties)
at java.util.Properties.getProperty(Properties.java:951)
at java.lang.System.getProperty(System.java:709)
at com.MyClass.myMethod(MyClass.java:344)
"waiting for monitor entry"
状態の意味を知りたいですか?また、この問題をデバッグするための参考になる点もありがとうございます。
Iこれを繰り返して呼び出すのではなく、システムプロパティのルックアップをキャッシュします。あなたは、アプリケーションの寿命の間に約12倍以上System.getProperty()を呼び出す必要はありません。つまり、ボトルネックではなくコード化する必要があります。 –
ねえ。いいポイントピーター! – peakit