Using java -XX:+PrintFlagsFinal
I found the TieredCompilation
flag, and I read about it a bit online.
Yet, I still don't know exactly what happens when setting it to false
.
I know that the compilation system supports 5 execution levels, basically splitted into interpreter, C1 and C2:
Two questions:
(1) By setting -XX:-TieredCompilation
, are some of this levels just disabled? If yes, which?
(2) Is there some flag to decide whether to disable C1 or C2, or to not compile at all?
-XX:-TieredCompilation
disables intermediate compilation tiers (1, 2, 3), so that a method is either interpreted or compiled at the maximum optimization level (C2).
As a side effect TieredCompilation
flag also changes the number of compiler threads, the compilation policy and the default code cache size. Note that with TieredCompilation
disabled
To disable C2 compiler and to leave only C1 with no extra overhead, set -XX:TieredStopAtLevel=1
.
To disable all JIT compilers and to run everything in interpreter, use -Xint
.