user2939830 user2939830 - 1 year ago 118
Java Question

100% cpu utilization need help analyzing thread dump

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
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),x72cdixp8fltabu,fhfw4e50c7fzu4t,1oq2npaxmtxz0dq,i0u997fhvxfagd3,cdewe4de6x3rhe4,w2ndwqw2ekwixkd,qsbst5ow6f59p75,9fx8w8qpfdhjmyx,levpqppb3ouh71q

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download