Prevent Full GCs: IHOP Threshold for Stable Throughput

The `-XX:InitiatingHeapOccupancyPercent` (IHOP) flag, defaulting to 45%, dictates when G1 starts its concurrent marking phase. Lowering this value (e.g., to 30-35% for high allocation rates) initiates marking earlier, providing more time for the concurrent cycle to complete and significantly reducing the risk of a costly Full GC, which can severely impact ML application throughput. Java 9+ features Adaptive IHOP, where G1 automatically adjusts this threshold.

The top 3

  1. G1's Adaptive IHOP: When to Override the Default: G1 GC defaults to Adaptive IHOP (Java 9+), dynamically adjusting the threshold based on historical data. However, for high-allocation ML workloads, manually setting `-XX:InitiatingHeapOccupancyPercent` (e.g., 30-35%) and disabling adaptive behavior (`-XX:-G1UseAdaptiveIHOP`) can be crucial to trigger concurrent cycles earlier and prevent costly full GCs.
  2. IHOP's Key Allies: ConcGCThreads and MaxGCPauseMillis: For stable throughput in ML workloads, IHOP works synergistically with other G1 flags. `ConcGCThreads` directly controls the number of threads for concurrent marking, ensuring cycles complete on time. `MaxGCPauseMillis` indirectly affects IHOP's effectiveness by influencing young generation sizing and object promotion rates, thereby impacting old generation occupancy.
  3. IHOP Misconfiguration Traps: Too High vs. Too Low: An `InitiatingHeapOccupancyPercent` (IHOP) set too high delays the start of concurrent marking, risking the old generation filling up and forcing a costly Full GC, which can cause pauses 10-100 times longer than normal young GCs. Conversely, setting IHOP too low can waste CPU cycles by initiating concurrent marking too frequently, potentially reducing overall application throughput by performing unnecessary work.

Sources

Open the full topic