Why is the output of MaxHeapSze different when calling -XX: + PrintFlagsFinal and -XX: + PrintCommandLineFlags?

Like the question, when I run the program with the JVM -XX + PrintFlagsFinal option, I can see the printed MaxHeapSize, as shown below:

bool MaxFDLimit = true {product} uintx MaxGCMinorPauseMillis = 4294967295 {product} uintx MaxGCPauseMillis = 4294967295 {product} uintx MaxHeapFreeRatio = 70 {product} **uintx MaxHeapSize := 1044381696 {product}** intx MaxInlineLevel = 9 {product} intx MaxInlineSize = 35 {product} intx MaxJavaStackTraceDepth = 1024 {product} 

While I run the same program with the JVM -XX + PrintCommandLineFlags option, I can see MaxHeapSize as:

 -XX:InitialHeapSize=65192896 **-XX:MaxHeapSize=1043086336** -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC 

Can you tell me why these two are different? I thought they should be the same.

0
source share
1 answer

Actual heap size may differ from what the user specified on the command line due to alignment and ergonomic adjustments. By default, the heap is aligned at 2 MB ( see CollectorPolicy.cpp ).

1044381696 - The final heap size after aligning 2 MB 1043086336.

+2
source

Source: https://habr.com/ru/post/1200107/


All Articles