Adaptive IHOP: G1's Default Smarts vs. ML Workload Needs
G1GC's Adaptive IHOP dynamically adjusts the concurrent marking threshold, typically starting at 45% heap occupancy, but high-allocation ML applications often benefit from manually lowering `InitiatingHeapOccupancyPercent` to 30-35% to preemptively trigger marking and avoid performance-degrading Full GCs.
The top 3
- Adaptive IHOP vs. Manual: ML Performance Edge: G1's default adaptive Initiating Heap Occupancy Percent (IHOP), starting at 45% old generation occupancy, aims to optimize, but highly dynamic ML workloads with varying allocation rates or short-lived humongous objects can often benefit from manual tuning of -XX:InitiatingHeapOccupancyPercent to prevent premature or delayed concurrent cycles and full GCs.
- Top 3 ML Workload Patterns Disrupting Adaptive IHOP: Adaptive IHOP struggles with ML workloads characterized by (1) rapid, unpredictable old generation allocation spikes, (2) frequent creation and early reclamation of short-lived humongous objects (which can inflate IHOP calculations), or (3) highly variable object promotion rates, leading to inefficient GC cycles or even Full GCs.
- Essential Metrics for G1 IHOP ML Tuning: To effectively tune G1's IHOP for ML workloads, monitor critical JVM metrics such as GC pause times (especially P99 and P99.9 latency), old generation occupancy trends, overall allocation rates, and the frequency of concurrent marking cycles and fallback Full GCs, often analyzed using tools like GC logs, Java Flight Recorder (JFR), or GCeasy.
Sources
Open the full topic