JVM Tools

Standard Java tools may be used to monitor the JVM.

Visual VM

https://visualvm.dev.java.net

Visual VM

Figure 5.1. Visual VM


JConsole

http://openjdk.java.net/tools/svc/jconsole

JConsole

Figure 5.2. JConsole


Java Mission Control and Flight Recorder

Flight Recorder - If using Oracle Java 7 or later, Java Mission Control and Flight Recorder is a built-in, low overhead tool for collecting JVM diagnostic and profiling data.

To enable (but not start) add the following VM deploy options:

-XX:+UnlockCommercialFeatures -XX:+FlightRecorder

The related GUI tool is Java Mission Control, jmc. Once the application is started your test run, you can select your JVM in mission control, select flight recorder and start recording.

Java Mission Control, JVM Select

Figure 5.3. Java Mission Control, JVM Select


Start Flight Recorder

Figure 5.4. Start Flight Recorder


Once the capture is finished, mission control will enable exploring the captured data.

Java Mission Control Explorer

Figure 5.5. Java Mission Control Explorer


Recording from the command line my be done with the jcmd command. See the jcmd manual page from the JDK, or Oracle online documentation for details.