Java Reference
In-Depth Information
always specify via the command line which of the three possible compilers she wants. That
kind of installation remains the exception. Things can be further complicated since deve-
lopers of HotSpot often use Solaris as their primary development system and hence discus-
sions (and sometimes documentation) gets confused by which installation paradigm is in use.
One last complication: for the sake of compatibility, the argument specifying which compiler
to use is not rigorously followed. If you have a 64-bit JVM and specify -client , the applica-
tion will use the 64-bit server compiler anyway. If you have a 32-bit JVM and you specify -
d64 , you will get an error that the given instance does not support a 64-bit JVM.
To summarize: the selection of the compiler is controlled by which JVM bits are installed
and by the compiler argument passed to the JVM. Table 4-4 shows the result when the given
argument is specified for the given installation.
Table 4-4. Result of compiler argument for OS combinations
Install bits
-client
-server
-d64
Linux 32-bit
32-bit client compiler 32-bit server compiler Error
Linux 64-bit
64-bit server compiler 64-bit server compiler 64-bit server compiler
Mac OS X
64-bit server compiler 64-bit server compiler 64-bit server compiler
Solaris 32-bit
32-bit client compiler 32-bit server compiler Error
Solaris 64-bit
32-bit client compiler 32-bit server compiler 64-bit server compiler
Windows 32-bit 32-bit client compiler 32-bit server compiler Error
Windows 64-bit 64-bit server compiler 64-bit server compiler 64-bit server compiler
In Java 8, when the server compiler is the default in any of these cases, tiered compilation is
also enabled by default.
What if no compiler argument is given at all? Then the JVM uses the default compiler for the
machine on which the code is running: the default compiler is a runtime choice. This choice
is made based on whether the JVM considers the machine to be a “client” machine or a
“server” machine. That decision is based on a combination of the operating system and num-
ber of CPUs on the machine; Table 4-5 lists the various defaults.
Search WWH ::




Custom Search