Integrated: 8366147: ZGC: ZPageAllocator::cleanup_failed_commit_single_partition may leak memory

Axel Boldt-Christmas aboldtch at openjdk.org
Fri Aug 29 07:37:47 UTC 2025


On Wed, 27 Aug 2025 09:56:33 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: 86d6a2e0
Author:    Axel Boldt-Christmas <aboldtch at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/86d6a2e05eb52ea2c603a06bce838a56d5ae507b
Stats:     22 lines in 2 files changed: 13 ins; 0 del; 9 mod

8366147: ZGC: ZPageAllocator::cleanup_failed_commit_single_partition may leak memory

Reviewed-by: stefank, sjohanss, jsikstro

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

PR: https://git.openjdk.org/jdk/pull/26954


More information about the hotspot-gc-dev mailing list