-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 27
-
Component/s: hotspot
In JDK-8372543, we use soft max heap size to calculate available space on the heap: `available(ShenandoahHeap::heap()->soft_max_capacity() * (100.0 - ShenandoahEvacReserve) / 100)`[1], the `available` function is essentially `capacity - used`[2]. However, in reality there are some waste (e.g.: small margin in a region that's not enough to allocate). Use freeset available would be closer to what's actually "available".
[1]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp#L429-L432
[2]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp#L434-L438
[1]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp#L429-L432
[2]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp#L434-L438