2

Is there have a limit for G1,some article mentioned the max region size is 32M,and max regions num is 2K,so it seem the max heap size is 64GB. But in our cluster,it's work well when the heap is 106GB:

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

Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 113816633344 (108544.0MB)
   NewSize                  = 1363144 (1.2999954223632812MB)
   MaxNewSize               = 68283269120 (65120.0MB)
   OldSize                  = 5452592 (5.1999969482421875MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 134217728 (128.0MB)
   G1HeapRegionSize         = 33554432 (32.0MB)

Heap Usage:
G1 Heap:
   regions  = 3392
   capacity = 113816633344 (108544.0MB)
   used     = 72851759528 (69476.85196685791MB)
   free     = 40964873816 (39067.14803314209MB)
   64.00800778196668% used
G1 Young Generation:
Eden Space:
   regions  = 535
   capacity = 39426457600 (37600.0MB)
   used     = 17951621120 (17120.0MB)
   free     = 21474836480 (20480.0MB)
   45.53191489361702% used
Survivor Space:
   regions  = 13
   capacity = 436207616 (416.0MB)
   used     = 436207616 (416.0MB)
   free     = 0 (0.0MB)
   100.0% used
G1 Old Generation:
   regions  = 1629
   capacity = 73953968128 (70528.0MB)
   used     = 54463930792 (51940.85196685791MB)
   free     = 19490037336 (18587.14803314209MB)
   73.64571796571278% used

18984 interned Strings occupying 2233784 bytes.

Versus CMS,used G1 process's use more VSZ(more than nearly 8GB),and use Native Memory Tracking,the diff:

JDK8 + G1 :               
 GC (reserved=4599924KB, committed=4599924KB) 
 Internal (reserved=3611979KB, committed=3611979KB)

JDK8 + CMS :              
GC (reserved=737869KB, committed=737869KB)
Internal (reserved=5451KB, committed=5451KB) 

in the detail,G1 initialize two heap:

[0x00007fca198d2386] ReservedSpace::initialize(unsigned long, unsigned long, bool, char*, unsigned long, bool)+0x256
[0x00007fca198d24ba] ReservedSpace::ReservedSpace(unsigned long, unsigned long)+0x6a
[0x00007fca193b1ef5] G1CollectedHeap::initialize()+0x475
[0x00007fca1989e753] Universe::initialize_heap()+0xf3
                             (reserved=1736704KB, committed=1736704KB)

[0x00007fca198d2386] ReservedSpace::initialize(unsigned long, unsigned long, bool, char*, unsigned long, bool)+0x256
[0x00007fca198d24ba] ReservedSpace::ReservedSpace(unsigned long, unsigned long)+0x6a
[0x00007fca193b1f75] G1CollectedHeap::initialize()+0x4f5
[0x00007fca1989e753] Universe::initialize_heap()+0xf3
                             (reserved=1736704KB, committed=1736704KB)

it seem initialize two G1 heap satisfy 106G heap?

  • 3
    Yes, it can handle much larger heaps. Most likely people were thinking of default values, because these values can be changed. – Peter Lawrey Mar 06 '17 at 09:19
  • You should provide links to “some article” that makes such fundamental claims, like “max regions num is 2K”. There is an attempt to create 2k regions initially, but as you can see in your own heap dump, the JVM has no problems with more regions like, say `3392`… – Holger Mar 06 '17 at 17:25
  • Versus CMS,used G1 process's use more VSZ(more than nearly 8GB),in actually,it trigger oom-killer in production – hellodengfei Mar 10 '17 at 07:05

0 Answers0