Java Reference
In-Depth Information
the concepts of this topic apply to any Java implementation, the specific flags and recom-
mendations apply only to Oracle's standard (HotSpot-based) JVM.
That caveat is applicable to earlier releases of the HotSpot JVM—flags and their default val-
ues change from release to release. Rather than attempting to be comprehensive and cover a
variety of now-outdated versions, the information in this topic covers only Java 7 (up
through 7u40) and Java 8 (the initial release only) JVMs. It is possible that later releases
(e.g., a hypothetical 7u60) may slightly change some of this information. Always consult the
release notes for important changes.
At an API level, different JVM implementations are much more compatible, though even
then there might be subtle differences between the way a particular class is implemented in
the Oracle HotSpot Java SE (or EE) platform and an alternate platform. The classes must be
functionally equivalent, but the actual implementation may change. Fortunately, that is infre-
quent, and unlikely to drastically affect performance.
For the remainder of this topic, the terms Java and JVM should be understood to refer spe-
cifically to the Oracle HotSpot implementation. Strictly speaking, saying “The JVM does not
compile code upon first execution” is wrong; there are Java implementations that do compile
code the first time it is executed. But that shorthand is much easier than continuing to write
(and read) “The Oracle HotSpot JVM…”
JVM Tuning Flags
With a few exceptions, the JVM accepts two kinds of flags: boolean flags, and flags that re-
quire a parameter.
Boolean flags use this syntax: -XX:+ FlagName enables the flag, and -XX:- FlagName disables
the flag.
Flags that require a parameter use this syntax: -XX: FlagName = something , meaning to set
the value of FlagName to something . In the text, the value of the flag is usually rendered
with something indicating an arbitrary value. For example, -XX:NewRatio= N means that the
NewRatio flag can be set to some arbitrary value N (where the implications of N are the focus
of the discussion).
The default value of each flag is discussed as the flag is introduced. That default is often a
combination of different factors: the platform on which the JVM is running and other
command-line arguments to the JVM. When in doubt, Basic VM Information shows how to
use the -XX:+PrintFlagsFinal flag (by default, false ) to determine the default value for a
Search WWH ::




Custom Search