I have a project with G1.The JVM Parameters are:
-Xmx12288m
-Xms12288m
-Xss256k
-XX:G1NewSizePercent=35
-XX:G1MaxNewSizePercent=60
-XX:MaxGCPauseMillis=200
-XX:+UseG1GC
-XX:-OmitStackTraceInFastThrow
-XX:MinHeapFreeRatio=30
-XX:MaxHeapFreeRatio=50
-XX:+UnlockExperimentalVMOptions
There is a youngc with the GC log: 2024-01-25T19:25:58.266+0800: 7483.790: [GC pause (G1 Evacuation Pause) (young) (to-space exhausted), 1.5322861 secs] [Eden: 6828.0M(6828.0M)->0.0B(4148.0M) Survivors: 272.0M->152.0M Heap: 11993.5M(12288.0M)->9724.0M(12288.0M)]
My heap capacity is 12G(min and max), the G1NewSizePercent is 35%, which means the max capacity of old region is 7987.2M. But the gc log shows the eden was 0 , survivors is 152M, heap is 9724M after younggc.
(1) Is the old region capacity: 9724(total capacity) - 152 (survivors) - 0(eden) = 9572M ? (2) If (1) is correct, why can the old region capacity be larger than 7987.2M?