Skip to content
Chris Newland edited this page Sep 7, 2015 · 2 revisions

JITWatch can be run in a headless mode (no GUI).

It takes a hotspot log file as input and can output:

  • The compilations timeline
  • The JIT data model (information about methods and compilations)
  • The JITWatch suggestions (failed inlines, unpredictable branches, etc.)

Launch headless mode using the launchHeadless scripts (.sh or .bat) or use the command:

"$JAVA_HOME/bin/java" -cp "$CLASSPATH" org.adoptopenjdk.jitwatch.launch.LaunchHeadless

The parameters to headless mode are:

Usage: LaunchHeadless <options> <hotspot log file>
options:
-e      Show parse errors
-m      Show model
-c      Show only compiled methods in model (use with -m)
-s      Show code suggestions
-t      Show compilation timeline
-f      Write output to headless.csv

The output is CSV format with a vertical bar as a separator "|".

If you want to load this CSV file into a spreadsheet such as Excel then you can prepend the file with:

sep=|

You could use the JITWatch output as part of your build process (e.g. a Jenkins stage) to ensure that no inlining failures have crept in to your program.

You will need a build stage to execute your code with HotSpot logging options and another step to run JITWatch in headless mode.