Usage:
• -XX:+PrintCommandLineFlags
Description:
The -XX:+PrintCommandLineFlags flag enables printing the values of the most
useful flags controlling the heap size and garbage collection, along with their
values. The values shown will either be the defaults provided by the JVM
installation, or the values as supplied by command line flags.
For example:
java -XX:+PrintCommandLineFlags -version
Prints (on an example device with 16 GB of RAM):
-XX:ConcGCThreads=2 -XX:G1ConcRefinementThreads=8 -XX:GCDrainStackTargetSize=64
-XX:InitialHeapSize=268435456 -XX:MarkStackSize=4194304 -XX:MaxHeapSize=4294967296
-XX:MinHeapSize=6815736 -XX:+PrintCommandLineFlags
-XX:ReservedCodeCacheSize=251658240 -XX:+SegmentedCodeCache
-XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseG1GC
If the maximum heap size is set to 8 GB using the -Xmx option:
java -Xmx8g -XX:+PrintCommandLineFlags -version
then the output would reflect the value specified:
-XX:ConcGCThreads=2 -XX:G1ConcRefinementThreads=8 -XX:GCDrainStackTargetSize=64
-XX:InitialHeapSize=268435456 -XX:MarkStackSize=4194304 -XX:MaxHeapSize=8589934592
-XX:MinHeapSize=6815736 -XX:+PrintCommandLineFlags
-XX:ReservedCodeCacheSize=251658240 -XX:+SegmentedCodeCache
-XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseG1GC
The flags printed by -XX:+PrintCommandLineFlags are selected as the most
commonly used flags for tuning the performance of the JVM, however there are
many more flags not printed by this command. To see the complete set of flags
along with their values, use the -XX:+PrintFlagsFinal flag in combination with
-XX:+UnlockDiagnosticVMOptions and -XX:+UnlockExperimentalVMOptions.
Default Value:
-XX:+PrintCommandLineFlags is off by default, i.e. command line flags are not
printed.
Errors:
None
Arguments Related to -XX:+PrintCommandLineFlags:
TODO: link to -XX:+PrintFlagsFinal
Related Posts:
None
NOTE:
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your
insights will help the entire 10+ million java developer community to develop
one standard source of documentation for all the JVM arguments.
Edit your Comment