JIT compiler log JVM option

If you want to see the log the JIT compiler is producing when running java and starting up the JVM in either client or server mode, you would need the -XX:+LogCompilation JVM flag option. In order to pass this flag we also need -XX:+UnlockDiagnosticVMOptions as well as -XX:LogFile= to store the XML log output that is produced.

In short for c1 JIT compiler or in other words JVM in client mode:

java -d32 -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation -XX:LogFile=output.xml Main

less ./output.xml | grep C1

for c2 JIT compiler or in other words JVM in server mode (Mac OS X JVM default mode):

java -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation -XX:LogFile=output.xml Main

less ./output.xml | grep C2

For further reading: LogCompilation Overview

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s