1. Different Java binaries support different compilers.
2. The compilers supported by different binaries are inconsistent among operating
systems and binary architectures.
3. A program doesn't necessarily use the compiler specified depending on the plat-
form support for that compiler.
Intermediate Tunings for the Compiler
For the most part, tuning the compiler is really just a matter of selecting the proper JVM and
compiler switch ( -client , -server or -XX:+TieredCompilation ) for the installation on
the target machine. Tiered compilation is usually the best choice for long-running applica-
tions and is within a few milliseconds of the performance of the client compiler on short-
There are a few cases in which additional tunings are required; those cases are explored in
Tuning the Code Cache
When the JVM compiles code, it holds the set of assembly-language instructions in the code
cache. The code cache has a fixed size, and once it has filled up, the JVM is not able to com-
pile any additional code.
It is easy to see the potential issue here if the code cache is too small. Some hot spots will get
compiled, but others will not: the application will end up running a lot of (very slow) inter-
This is more frequently an issue when using either the client compiler or tiered compilation.
When the regular server compiler is used, it is somewhat unlikely that the number of classes
eligible for compilation will fill the code cache; typically only a handful of classes will be
compiled. But the number of classes eligible for compilation when using the client compiler
(and hence also eligible for compilation when tiered compilation is enabled) is potentially