Java Reference
In-Depth Information
% jcmd process_id VM.command_line
JVM tuning flags
The tuning flags in effect for an application can be obtained like this:
% jcmd process_id VM.flags [-all]
Working with tuning flags
There are a lot of tuning flags that can be given to a JVM, and many of those flags are a ma-
jor focus of this topic. Keeping track of those flags and their default values can be a little
daunting; those last two examples of jcmd are quite useful in that regard. The command_line
command shows which flags were specified directly on the command line. The flags com-
mand shows which flags were set on the command line, plus some flags that were set direc-
tly by the JVM (because their value was determined ergonomically). Including the -all op-
tion lists every flag within the JVM.
There are hundreds of JVM tuning flags, and most of them are very obscure; it is recommen-
ded that most of them never be changed (see Too Much Information? ) . Figuring out which
flags are in effect is a frequent task when diagnosing performance issues, and the jcmd com-
mands can do that for a running JVM. Often, what you'd rather figure out is what the
platform-specific defaults for a particular JVM are, in which case using the -
XX:+PrintFlagsFinal option on the command line is more useful.
A useful way to determine what the flags are set to on a particular platform is to execute this
command:
% java other_options -XX:+PrintFlagsFinal -version
...Hundreds of lines of output, including...
uintx InitialHeapSize := 4169431040 {product}
intx InlineSmallCode = 2000 {pd product}
You should include all other options on the command line because some options affect oth-
ers, particularly when setting GC-related flags. This will print out the entire list of JVM flags
and their values (the same as is printed via the VM.flags -all option to jcmd for a live
JVM).
Search WWH ::




Custom Search