RFR: 8366147: ZGC: ZPageAllocator::cleanup_failed_commit_single_partition may leak memory [v4]
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Aug 28 12:21:29 UTC 2025
> ZPageAllocator::cleanup_failed_commit_single_partition is responsible for cleaning up the successful part of a failed allocation by returning it to the cache so it can be reused.
>
> When a commit fails the the parts that should be returned is any "harvested" memory (memory it took from the cache) and any partially freshly committed memory.
>
> In a late revision of [JDK-8350441](https://bugs.openjdk.org/browse/JDK-8350441) we rewrote part of the allocation logic such that the "harvested" part was no longer part of the partial vmems after successfully harvesting. However the cleanup code was not adapted to this change.
>
> The solution is to add back both the harvested and newly committed memory, not just the newly committed part.
>
> * Testing (In progress)
> * Oracle supported platforms tier1 + ZGC tier1-8
Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
- Merge remote-tracking branch 'upstream_jdk/master' into JDK-8366147
- Change name and addition order
- Remove extra newline
- Run in driver rather than othervm
- 8366147: ZGC: ZPageAllocator::cleanup_failed_commit_single_partition may leak memory
- Run in driver rather than othervm
- 8366223: ZGC: ZPageAllocator::cleanup_failed_commit_multi_partition is broken
-------------
Changes: https://git.openjdk.org/jdk/pull/26954/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26954&range=03
Stats: 19 lines in 2 files changed: 13 ins; 0 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/26954.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26954/head:pull/26954
PR: https://git.openjdk.org/jdk/pull/26954
More information about the hotspot-gc-dev
mailing list