RFR: 8236073: G1: Use SoftMaxHeapSize to guide GC heuristics [v8]

Man Cao manc at openjdk.org
Wed Apr 9 07:27:33 UTC 2025


On Thu, 3 Apr 2025 07:08:19 GMT, Man Cao <manc at openjdk.org> wrote:

>> Hi all,
>> 
>> I have implemented SoftMaxHeapSize for G1 as attached. It is completely reworked compared to [previous PR](https://github.com/openjdk/jdk/pull/20783), and excludes code for `CurrentMaxHeapSize`. I believe I have addressed all direct concerns from [previous email thread](https://mail.openjdk.org/pipermail/hotspot-gc-dev/2024-November/050214.html), such as:
>> 
>> - does not respect `MinHeapSize`;
>> - being too "blunt" and does not respect other G1 heuristics and flags for resizing, such as `MinHeapFreeRatio`, `MaxHeapFreeRatio`;
>> - does not affect heuristcs to trigger a concurrent cycle;
>> 
>> [This recent thread](https://mail.openjdk.org/pipermail/hotspot-gc-dev/2025-March/051619.html) also has some context.
>
> Man Cao has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use Atomic::load for flag

Thank you for creating [JDK-8353716](https://bugs.openjdk.org/browse/JDK-8353716)!

> Last time this has been mentioned in the hotspot-gc-dev list has been [here](https://mail.openjdk.org/pipermail/hotspot-gc-dev/2025-February/051079.html). I remember giving multiple outlines to everyone involved earlier, each mentioning that `Min/MaxHeapFreeRatio` need to go away because it's in the way, so I was/am a bit surprised on this response.

Apology for overlooking previous mentions about `Min/MaxHeapFreeRatio`. Previous mentions were mostly inside responses to complicated issues, and I have hardly got the time to follow hotspot-gc-dev closely. To be honest, we didn't pay much attention to `Min/MaxHeapFreeRatio` before I started working on this PR.

I guess this is a good example that a one-pager doc/umbrella bug provides cleaner communication and additional values over email discussion, especially when one party already has a pretty detailed plan for how it should be done.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24211#issuecomment-2788609820


More information about the hotspot-gc-dev mailing list