How the survivor size is calculated

411 views Asked by At

Following is heap usage information is from jmap -heap, I am using Java 1.8, I noticed that the survivor space's capacity is only 40MB, I would ask how this 40MB is calculated.

Garbage-First (G1) GC with 8 thread(s)

Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 17179869184 (16384.0MB)
   NewSize                  = 1073741824 (1024.0MB)
   MaxNewSize               = 10301210624 (9824.0MB)
   OldSize                  = 5452592 (5.1999969482421875MB)
   NewRatio                 = 2
   SurvivorRatio            = 6
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 2147483648 (2048.0MB)
   G1HeapRegionSize         = 8388608 (8.0MB)

Heap Usage:
G1 Heap:
   regions  = 2048
   capacity = 17179869184 (16384.0MB)
   used     = 2224567944 (2121.513313293457MB)
   free     = 14955301240 (14262.486686706543MB)
   12.948689656332135% used
G1 Young Generation:
Eden Space:
   regions  = 74
   capacity = 5368709120 (5120.0MB)
   used     = 620756992 (592.0MB)
   free     = 4747952128 (4528.0MB)
   11.5625% used
Survivor Space:
   regions  = 5
   capacity = 41943040 (40.0MB)
   used     = 41943040 (40.0MB)
   free     = 0 (0.0MB)
   100.0% used
G1 Old Generation:
   regions  = 187
   capacity = 3179282432 (3032.0MB)
   used     = 1561867912 (1489.513313293457MB)
   free     = 1617414520 (1542.486686706543MB)
   49.126428538702406% used
0

There are 0 answers