Usage:
This flag enables displaying of JVM arguments that appeared on the startup command.
Since:
Starting from JDK 6.
Examples:
To enable the display of the flag:
java -XX:+PrintCommandLineFlags MainClass
Description:
The JVM argument “PrintCommandLineFlags” can be quite useful. This parameter causes the JVM to print out the names and values of the detailed JVM parameters (XX) that have been set by the user or by the JVM. In other words, it enumerates the parameters with ":=" in the third column of the result of “-XX:+PrintFlagsFinal”. In this way, we can use “-XX:+PrintCommandLineFlags” as a shortcut to view the modified parameters. See the example below.
java -XX:+PrintCommandLineFlags -version
As we can see, the JVM displayed to us the following used flags with their values:
-XX:G1ConcRefinementThreads=10 -XX:GCDrainStackTargetSize=64 -XX:InitialHeapSize=261411712 -XX:MaxHeapSize=4182587392 -XX:+PrintCommandLineFlags -XX:ReservedCodeCacheSize=251658240 -XX:+SegmentedCodeCache -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseG1GC
Now if we set “-XX:+PrintCommandLineFlags” every time we start the java program and output it to the log file, it will record the impact of the JVM parameters we set on the application performance.
Default Value:
By default, this flag is disabled.
Note:
I suggest that the -XX:+PrintCommandLineFlags parameter should always be set in the JVM startup configuration. Because you never know when you'll need this information.
Arguments related:
PrintFlagsFinal
Related Posts:
Edit your Comment