The JVM interprets and executes bytecode at run-time.
C1, the client compiler, is optimised for fast start-up time.
C2, the server compiler, is optimised for improved overall performance.
Tiered compilation (
-XX:+TieredCompilation) mixes both compilers to optimise performance:
- At startup time, JVM code is interpreted and profiling begins to identify hotspots.
- Hot paths are compiled with C1 to quickly reach native performance.
- Bytecode is later recompiled using C2 as more profiling information becomes available.
Enabling tiered compilation also enables
Logging compilation events
Enable the compilation log with
-XX:+PrintCompilation. Log entries will look something like:
$compilation_id $attributes ($tiered_level) $method_name $deopt ($size)
timestampis the number of seconds that elapsed between the JVM's startup and compilation completing.
compilation_iduniquely identifies the compilation task within the JVM.
!indicates the method has an exception handler.
bindicates compilation blocked execution rather than taking place on a background thread.
nindicates the compilation occurred for a wrapper around a native method.
method_nameis the name of the method being compiled.
deoptmay detail deoptimisations applied:
made non entrantindicates incorrect or incomplete completion, and that future callers won't use this method.
made zombieindicates code's not in use and ready for GC.
On-Stack Replacement allows the JVM to replace code on the stack with an optimised version, even during execution of a loop.