RFR: 8366147: ZGC: ZPageAllocator::cleanup_failed_commit_single_partition may leak memory [v6]

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


On Thu, 28 Aug 2025 13:14:18 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
>
> Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update variable names

Thanks for the reviews

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

PR Comment: https://git.openjdk.org/jdk/pull/26954#issuecomment-3235850738


More information about the hotspot-gc-dev mailing list