RFR: 8353264: ZGC: Windows heap unreserving is broken [v2]
Joel Sikström
jsikstro at openjdk.org
Thu Apr 3 09:32:12 UTC 2025
On Thu, 3 Apr 2025 09:29:08 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> During the development of [JDK-8350441](https://bugs.openjdk.org/browse/JDK-8350441) we found that the functionality to release reserved memory for the heap is broken. The current implementation passes in the size of the reserved memory area, but according to the documentation the call should be done with `0` as the dwSize argument:
>>
>> If the dwFreeType parameter is MEM_RELEASE, dwSize must be 0 (zero)
>>
>>
>> Generational ZGC isn't affected by this because we never release any reserved memory for the heap. However, the changes in JDK-8350441 is going to change that and we will start to release memory in certain corner-cases.
>>
>> In Single-gen ZGC, which exists in older releases, we have paths that do release memory for "views" into the heap. This only happens if something blocks the memory areas were we want to set up our "views" of the heap. We should probably backport this fix to the affected releases.
>>
>> I've added a unit test that provokes the problem and I have run this fix together with the changes for JDK-8350441.
>
> Stefan Karlsson has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - Merge remote-tracking branch 'upstream/master' into 8353264_zgc_unreserve
> - Make addtions static
> - 8353264: ZGC: Windows heap unreserving is broken
Marked as reviewed by jsikstro (Committer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/24377#pullrequestreview-2739122546
More information about the hotspot-gc-dev
mailing list