Kennis Java Mission Control

Java Mission Control

If you haven't already done so, I encourage you to update to JDK 1.7 u40 (or higher, u45 has just been released) as soon as possible. Update 40 shipped with new monitoring and diagnostics tool called Java Mission Control.

This marks the convergence between Sun HotSpot VM and BEA JRockit VM which are nowadays owned by Oracle. Note that Java Mission Control is free for use during development and testing but requires a license when used for production purposes. More specific it requires a Java SE Advanced license in production. These go for about $100 per named user or $5000 per processor.

Running Java Mission Control on OS X

To use Java Mission Control specify the following VM arguments and start your Java application.

-XX:+UnlockCommercialFeatures -XX:+FlightRecorder

Now make sure you use Java 1.7

export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)

And start Java Mission Control:

jmc

This will bring up the Eclipse-based Java Mission Control tool which gives a lot of insight in for example CPU usage.
cpu
And memory and GC usage
mem
As well as I/O usage.
io
Definitely something to keep in your toolchain besides VisualVM, jmap, etc.