Which Java Thread Is Hogging CPU

Recently I needed to investigate a CPU overload problem on an embedded system, which ran Oracle EJRE with limited processor power and memory. At the problem time, the Java process took more than 80% of the CPU time. A java profiler, even the shrinked version, such as Jprofiler or YourKit,  couldn’t run on this platform.

Luckily, I found a JConsole plugin called TopThreads  that came for rescue. After enabling JMX agent on the embeded unit (ip address 10.17.2.3) at port 4567, I ran Jconsole from my PC with the command

jconsole.exe -pluginpath C:\Users\liuzy163\Downloads\topthreads-1.1.jar 10.17.2.3:4567

The sampling frequency may be needed to adjusted as per prompted. But once connected, I was able to see easily tell which Java threads (and their stack trace) were hogging CPU.

Advertisements
This entry was posted in Java, Tool and Debug and tagged , , . Bookmark the permalink.

One Response to Which Java Thread Is Hogging CPU

  1. Pingback: Tomcat Server Slow Due To Blocked SeedGenerator Thread on Insufficient Random Number On Linux | SW Notes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s