Search code examples
javajvmjitjvm-hotspotjvm-arguments

java -XX:+PrintCompilation <class name> doesn't show any compilation output


I ran the following sample java class following some Java course material. In the beginning, I was able to see compilation output in the console. From some point, '-XX:+PrintCompilation' started NOT to show any compilation log output. Any idea?

➜  bin java -XX:+PrintCompilation Main 50
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233]
Elapsed time was 2ms.

My java version:

➜  bin java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
Eclipse OpenJ9 VM (build openj9-0.20.0, JRE 1.8.0 Mac OS X amd64-64-Bit Compressed References 20200416_527 (JIT enabled, AOT enabled)
OpenJ9   - 05fa2d361
OMR      - d4365f371
JCL      - cfa47e66cd based on jdk8u252-b09)

Solution

  • -XX:+PrintCompilation is an option of the HotSpot JVM. You are using OpenJ9 VM though.

    To log JIT compilation in OpenJ9, use -Xjit:verbose