Essential Metrics to Detect Impending G1GC Full GCs

Proactively identify potential Full GCs by monitoring key metrics like overall heap occupancy, old generation usage, humongous object allocation rates, and GC pause times, often visible through GC logs or JMX.

The top 3

  1. Critical IHOP & Old Gen Occupancy Thresholds: Monitor the Old Generation's occupancy, as G1GC initiates concurrent marking when it hits `InitiatingHeapOccupancyPercent` (default 45%); consistent high usage (e.g., 70-80% before marking completion) signals a high risk of Full GC.
  2. Top 3 G1GC Log Warnings for Impending Full GCs: Watch for specific messages in G1GC logs like "Evacuation Failure," "to-space exhausted," and "concurrent marking didn't finish in time," as these directly precede or indicate a high risk of a Full GC.
  3. Humongous Object Allocation Rate & Fragmentation: Track the allocation rate and presence of humongous objects (>50% of a region size), as their inability to find contiguous free regions is a common cause of G1GC full GCs and heap fragmentation.

Sources

Open the full topic