Java Reference
In-Depth Information
If the server compiler queue is full, methods will be pulled from the server queue and com-
piled at level 2, which is the level at which the C1 compiler uses the invocation and back-
edge counters (but doesn't require profile feedback). That gets the method compiled more
quickly; the method will later be compiled at level 3 after the C1 compiler has gathered pro-
file information, and finally compiled at level 4 when the server compiler queue is less busy.
On the other hand, if the client compiler is full, a method that is scheduled for compilation at
level 3 may become eligible for level 4 compilation while still waiting to be compiled at
level 3. In that case, it is quickly compiled to level 2 and then transitioned to level 4.
Trivial methods may start in either levels 2 or 3 but then go to level 1 because of their trivial
nature. If the server compiler for some reason cannot compile the code, it will also go to
level 1.
And of course when code is deoptimized, it goes to level 0.
There are flags that control some of this behavior, but expecting results when tuning at this
level is quite optimistic. The best case for performance happens when methods are compiled
as expected: tier 0 → tier 3 → tier 4. If methods frequently get compiled into tier 2 and extra
CPU cycles are available, consider increasing the number of compiler threads; that will re-
duce the size of the server compiler queue. If no extra CPU cycles are available, then all you
can do is attempt to reduce the size of the application.
1. Tiered compilation can operate at five distinct levels among the two compilers.
2. Changing the path between levels is not recommended; this section just helps to
explain the output of the compilation log.
This chapter has provided a lot of details about how just-in-time compilation works. From a
tuning perspective, the simple choice here is to use the server compiler with tiered compila-
tion for virtually everything; this will solve 90% of compiler-related performance issues. Just
make sure that the code cache is sized large enough, and the compiler will provide pretty
much all the performance that is possible.
Search WWH ::

Custom Search