Integrated: 8353264: ZGC: Windows heap unreserving is broken
Stefan Karlsson
stefank at openjdk.org
Thu Apr 3 10:48:01 UTC 2025
On Wed, 2 Apr 2025 11:35:36 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.
This pull request has now been integrated.
Changeset: ffca4f2d
Author: Stefan Karlsson <stefank at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/ffca4f2da84cb8711794d8e692d176a7e785e7b1
Stats: 27 lines in 2 files changed: 24 ins; 0 del; 3 mod
8353264: ZGC: Windows heap unreserving is broken
Reviewed-by: jsikstro, aboldtch, eosterlund, stuefe
-------------
PR: https://git.openjdk.org/jdk/pull/24377
More information about the hotspot-gc-dev
mailing list