A full GC cycle examines and reclaims objects across the heap instead of limiting collection to a young-generation region. Frequent full GCs can create performance problems through repeated pauses and memory-management overhead. section 11.4.1 section 11.4.3
Interpret a full-GC pattern by checking:
- Pause duration and recurrence: repeated pauses above roughly 50 milliseconds warrant investigation, especially when they create stop-the-world latency spikes. section 11.4.1
- Heap usage before and after collection: minimal reclamation suggests retained objects or a possible memory leak. section 11.4.1 section 11.5
- Effective but frequent reclamation: repeated full GCs with peaks and valleys in memory usage usually indicate an under-provisioned heap rather than a leak. section 11.4.3
Reading a full-GC sequence
A log showing repeated full collections such as “8192M->6100M(8192M), 2.345678 secs” demonstrates substantial reclamation but long pauses. If this pattern continues, increasing the heap with -Xmx and -Xms may provide short-term relief; optimizing memory use remains the sustainable response. section 11.4.3
[GC pause (G1 Evacuation Pause) (mixed), 0.01506789 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.01783456 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.02021234 secs] [Full GC (Allocation Failure) 8192M->6100M(8192M), 2.345678 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.01901234 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.02115678 secs] [Full GC (Allocation Failure) 8192M->5800M(8192M), 2.678901 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.0987654 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.02254321 secs] [Full GC (Allocation Failure) 8192M->5600M(8192M), 2.789012 secs]
Compare full-GC pause durations and before-and-after heap sizes to distinguish memory pressure from ineffective reclamation. section 11.4.3
