Standard Java tools may be used to monitor the JVM.
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.
Once the capture is finished, mission control will enable exploring the captured data.
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.