"http-localhost-8080-70" daemon prio=10 tid=0x00002aaba8a28800 nid=0x611d in Object.wait() [0x0000000046275000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aab1e6a9708> (a org.apache.tomcat.util.net.JIoEndpoint$Worker) at java.lang.Object.wait(Object.java:485)
- locked <0x00002aab1e6a9708> (a org.apache.tomcat.util.net.JIoEndpoint$Worker) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)
I am investigating slow performance of my app. 65% of the threads are in this state (WAITING).
I cant understand what the locked and waiting lines mean. Please explain.
When a thread executes line 02. it will show up as -locked <instance address> (type).
When a thread executes line 04. it will show up as - waiting on <instance address> (type).
You can also get 'locked' if you use a synchronized method in an instance of the JIoEndpoint.Worker class. The problem is that you have a lot of threads wait()ing and maybe not enough notify()s happening.
Joined: Oct 01, 2002
Thanks for the prompt response. Another problem is that i don't know what needs to happen for the notify to take place.
Clearly the thread is busy doing something.
Can you recommend something in order to get much more detailed info ? For ex : I would like to what business methods in my app are waiting and which ones are slow to notify.
I downloaded TDA to analyze my thread dumps and this is what it said :
Overall Thread Count 322
Overall Monitor Count 209
Number of threads waiting for a monitor 0
Number of threads locking a monitor 184
Number of threads sleeping on a monitor 216
Number of deadlocks 0
Number of Monitors without locking threads 0
67% of all threads are sleeping on a monitor.
This might indicate they are waiting for some external resource (e.g. database) which is overloaded or not available or are just waiting to get to do something (idle threads). You should check the sleeping threads with a filter excluding all idle threads.
"Number of threads sleeping on a monitor 216" - Doesn't this mean that they are waiting for a notify ?
I am going to try and get the stack trace and see what i can find.
Joined: Oct 01, 2002
Quick question. I am running Jboss. I got the thread dump using "/jstack pid" command but the dump file don't show any application classes that are being invoked.
The file contains Threads like i showed in my first post.
How do i get a stack trace that shows my application classes as well ?