Thursday, January 17, 2013

Eclipse Plugins : JVM Monitor

JVM Monitor (http://www.jvmmonitor.org/)  is an excellent tool for generating a call tree for a functionality. It's an Eclipse plugin and is actually a java profiler.

Install the plugin from the update site
http://www.jvmmonitor.org/updates/3.8

Once you install the plugin you get a new perspective called "Java Monitor". In that, there is a Explorer which lists down all the JVMs. Right click on the JVM you want to monitor and click start monitoring.



In the properties window there are several tabs, select the CPU tab as shown above and click on “select profiles Java packages” which opens up a window that allows you to select the packages that you need to instrument.

Once selected, you can see the “run” button in green which says “Resume CPU Profiling”


Click on that and it will start generating call tree for all the threads in that JVM using the instrumented classes.

You can click on the “pause” button to stop.

What I usually do is have debug points before and after the functionality I want to learn, run a test, start monitoring when it stops at the first break point and stops monitoring when the second break point is reached.


You can save this and it will generate a .cpu file that can be used for later reference. You can easily search through the call tree and see what classes are called.

No comments:

Post a Comment