RFR: 8352765: G1CollectedHeap::expand_and_allocate() may fail to allocate even after heap expansion succeeds [v2]

Ivan Walulya iwalulya at openjdk.org
Mon Mar 31 11:18:14 UTC 2025


On Fri, 28 Mar 2025 06:49:04 GMT, Man Cao <manc at openjdk.org> wrote:

>> Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Thomas Review
>
> Thank you for the quick fix!
> 
> I just have a two questions, which probably does not need to be addressed in this PR.
> 1. Is it possible for `expand_and_allocate()` to run into the [`receiving_additional_eden = 0;`](https://github.com/openjdk/jdk/blob/2ea1557a0fdaf551d75365d1351bfbd73319dcfb/src/hotspot/share/gc/g1/g1Policy.cpp#L320) situation under the `if (allocated_young_length >= desired_young_length)` branch?
> 2. It feels like G1 should recalculate young list length parameters after a successful `expand()` or `shrink()`. Currently `G1Policy::record_new_heap_size()` only recalculates the min/max young lengths. Is it reasonable to run `calculate_young_desired_length()` and `calculate_young_target_length()` inside `G1Policy::record_new_heap_size()`?

Thanks @caoman and @tschatzl for the reviews!

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

PR Comment: https://git.openjdk.org/jdk/pull/24257#issuecomment-2765917714


More information about the hotspot-gc-dev mailing list