G1GC Proactive Tuning: Optimizing IHOP for ML
Adjust `-XX:InitiatingHeapOccupancyPercent` (IHOP), often to a lower percentage (e.g., 30-35% for high allocation rates), to proactively control when the G1 Garbage Collector initiates its concurrent marking cycle, thereby preventing full GCs and ensuring predictable latency for large ML heaps.
The top 3
- 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.
- IHOP's Top Priority: Avoiding Costly Full GCs for ML: The primary goal of proactive IHOP tuning for ML workloads is to prevent expensive 'stop-the-world' Full GCs, which can cause application pauses 10-100 times longer than normal young GCs, severely impacting the latency and throughput of real-time machine learning inference and training.
- IHOP Tuning: Top 3 Factors for ML Throughput & Stability: Optimal IHOP tuning for ML performance hinges on three critical factors: 1) the application's object allocation rate (lower IHOP for high rates), 2) balancing with `MaxGCPauseMillis` to meet latency goals, and 3) sufficient `G1ReservePercent` to provide a buffer for object evacuation and prevent `Evacuation Failure`.
Sources
Open the full topic