Proactive GC: -XX:InitiatingHeapOccupancyPercent for ML
The `-XX:InitiatingHeapOccupancyPercent` (IHOP) flag controls the heap occupancy threshold (default 45%) at which G1 initiates a concurrent marking cycle. For ML workloads with high allocation rates, lowering IHOP (e.g., 30-35%) can prevent the old generation from filling up too quickly, thereby avoiding costly Full GCs.
The top 3
- Optimizing IHOP for ML: Key Percentage Ranges: For memory-intensive ML applications, lowering `-XX:InitiatingHeapOccupancyPercent` to 30-35% can trigger earlier concurrent marking, preventing costly Full GCs, while the default is 45% of the heap occupancy.
- Adaptive vs. Manual IHOP: ML Performance Choices: While Java 9+ G1 defaults to Adaptive IHOP, which dynamically adjusts the threshold, explicitly disabling it with `-XX:-G1UseAdaptiveIHOP` and setting a fixed value can provide more predictable GC behavior for specific ML workloads.
- IHOP Synergy: G1 Flags for ML Memory Control: `InitiatingHeapOccupancyPercent` works synergistically with flags like `MaxGCPauseMillis` to manage GC pause targets and `G1HeapRegionSize` to optimize humongous object handling, which can prematurely trigger marking or Full GCs if not tuned for ML workloads.
Sources
Open the full topic