Humongous Objects: IHOP's Unexpected Allocation Triggers
Large 'humongous' objects (over 50% of a region size) are directly allocated to the old generation and can prematurely trigger G1GC's initial mark phase if the IHOP threshold is exceeded. Historically, adaptive IHOP calculations could be skewed by short-lived humongous objects, leading to an erroneously low IHOP and excessive concurrent cycles, a bug resolved in JDK 11.0.13.
The top 3
- ML's Top 3 Humongous Object Generators: Large arrays of primitive types, multi-dimensional tensors for model parameters, and expansive in-memory datasets are common culprits in ML workloads that often exceed G1GC's humongous object threshold.
- Humongous Objects: G1GC's Triple Performance Hit: These objects prematurely trigger concurrent marking cycles, cause significant heap fragmentation by requiring contiguous regions, and historically (pre-JDK 8u40) were only reclaimable during costly Full GCs.
- Top 3 Strategies to Tame Humongous Allocations: Mitigate humongous object impact by increasing `G1HeapRegionSize` to raise the humongous threshold, providing more overall heap memory (`-Xmx`), or refactoring application code to break down large data structures into smaller objects.
Sources
Open the full topic