Top 3 Triggers for G1GC Full GCs in ML Workloads
Even with G1GC, Full GCs can be triggered by evacuation failures (heap too small), concurrent marking not finishing in time (allocation rate too high), and excessive humongous objects leading to fragmentation.
The top 3
- Evacuation Failure: Heap Too Small or Over-Allocated: G1GC triggers a Full GC when it cannot find sufficient 'to-space' regions to evacuate live objects during a young or mixed collection, often indicating an undersized heap (-Xmx) or an extreme spike in live data that exceeds available memory.
- Concurrent Mode Failure: Marking Lagging Allocation: A Full GC occurs if the application's object allocation rate outpaces G1's concurrent marking phase, causing the old generation to fill up before garbage can be identified and reclaimed. This often points to an `InitiatingHeapOccupancyPercent` (IHOP) set too high or insufficient `ConcGCThreads`.
- Humongous Object Fragmentation & Allocation: ML workloads frequently allocate large "humongous objects" (exceeding 50% of a G1 region). These bypass young GC and demand contiguous old generation space, leading to heap fragmentation and Full GCs when new humongous allocations fail to find suitable regions.
Sources
Open the full topic