When unreserving memory we use VirtualFreeEx with the MEM_RELEASE flag. The API documentation states:
```
If the dwFreeType parameter is MEM_RELEASE, dwSize must be 0 (zero)
```
but our implementation passes in the expected size instead of 0.
Generational ZGC isn't affected by this because we never unreserve any heap memory. However, there are coming changes to NUMA support that starts to unreserve excess memory.
In older releases in Single-gen ZGC, we have paths that do call unreserve in certain corner-cases during startup, so this fix should probably be backported to those releases.
```
If the dwFreeType parameter is MEM_RELEASE, dwSize must be 0 (zero)
```
but our implementation passes in the expected size instead of 0.
Generational ZGC isn't affected by this because we never unreserve any heap memory. However, there are coming changes to NUMA support that starts to unreserve excess memory.
In older releases in Single-gen ZGC, we have paths that do call unreserve in certain corner-cases during startup, so this fix should probably be backported to those releases.
- links to
-
Commit(master) openjdk/jdk/ffca4f2d
-
Review(master) openjdk/jdk/24377