Minimizing Heap Waste: Forcing More Mixed GCs

The `-XX:G1HeapWastePercent` flag controls the percentage of reclaimable memory G1 tolerates before stopping mixed garbage collections. Reducing its default value (typically 5%) compels G1 to perform more mixed GCs, even for regions with less reclaimable space, thereby aggressively reclaiming memory and preventing the heap from reaching a state that necessitates a Full GC.

Sources

Open the full topic