Question

I used jstack to get a thread dump of the PID with the highest cpu utilization. It pointed to the thread with nid 0x4974.

"VM Thread" prio=10 tid=0x00007ffc60068800 nid=0x4974 runnable "VM Periodic Task Thread" prio=10 tid=0x00007ffc60098000 nid=0x497b waiting on condition JNI global references: 1182

Im having a problem progressing with the analysis because it doesn't have the state of the thread and what code is being executed unlike the sample thread dumps that I've seen on the web. And is there any freeware preferably online that can analyze a .txt threaddump file?

Thanks for those who replied. Ok so I was able to learn how to use samurai,tda and the ibm thread dump tool. It seems that the problem lies with the number of threads being created,threads waiting for monitor,locking and blocking. But I was wondering if you guys have additional inputs. This is what i got from TDA:

When its at 100% cpu utilization

Overall Thread Count    1001
Overall Monitor Count   644
Number of threads waiting for a monitor  50
Number of threads locking a monitor 636
Number of threads sleeping on a monitor 0
Number of deadlocks 0
Number of Monitors without locking threads 0

After I reset

Overall Thread Count  32
Overall Monitor Count  13
Number of threads waiting for a monitor  0
Number of threads locking a monitor  13
Number of threads sleeping on a monitor  13
Number of deadlocks 0
Number of Monitors without locking threads 0

40% 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.

We only have about 60 clients.

I uploaded the threaddumps when cpu utilization is at 100% and after reseting. I also included the tools that i used (samurai,tda,and ibm thread and monitor dump analyzer) http://www.mediafire.com/?901mduvodm97d8v,x72cdixp8fltabu,fhfw4e50c7fzu4t,1oq2npaxmtxz0dq,i0u997fhvxfagd3,cdewe4de6x3rhe4,w2ndwqw2ekwixkd,qsbst5ow6f59p75,9fx8w8qpfdhjmyx,levpqppb3ouh71q

Était-ce utile?

La solution 2

Go to IBM Thread and Monitor Dump Analyzer for Java to download the tool from IBM. But for your purpose, you might be able to analyze the thread dump by yourself and map the ID you find from jstack with thread stack trace in a thread dump. To get a thread dump :

on Linux: kill -3 pid
on Windows: Ctrl-Break (not Ctrl-C)

After that you can copy the thread dump from your command window or stdout.

Autres conseils

These internal threads don't have a Java thread stack so none of the normal tools will help. If these are consuming excessive CPU I would first suspect a bug in the version of Java you are using. I would try this with Java 6 update 45 or Java 7 update 45.

To diagnose this problem you need a native stack dump and a good understanding of the internals of the JVM.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top