RFR: 8352765: G1CollectedHeap::expand_and_allocate() may fail to allocate even after heap expansion succeeds [v2]
Ivan Walulya
iwalulya at openjdk.org
Thu Mar 27 14:33:34 UTC 2025
> Hi,
>
> Please review this change to ensure that G1 provisions for at least one Eden region after a GC when computing the young length target.
>
> The issue reported in the CR occurs at the end of a GC, after successfully expanding the heap, an allocation fails because `policy()->should_allocate_mutator_region()` returns false. This happens because the computation did not properly account for young regions already allocated as survivor regions, leading to an Eden region target of zero.
>
> With this change, we factor in the young regions that have already been allocated as survivor regions and ensure that at least one region is targeted for Eden.
>
> Testing: Tier 1-3
> Reproducer in the CR.
Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:
Thomas Review
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24257/files
- new: https://git.openjdk.org/jdk/pull/24257/files/7eea1ee3..041b478c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24257&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24257&range=00-01
Stats: 7 lines in 1 file changed: 1 ins; 1 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/24257.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24257/head:pull/24257
PR: https://git.openjdk.org/jdk/pull/24257
More information about the hotspot-gc-dev
mailing list