RFR: 8375747: ZGC: ZForwardingTest is unable to commit memory on Windows

Stefan Karlsson stefank at openjdk.org
Wed Jan 28 21:02:52 UTC 2026


On Wed, 28 Jan 2026 20:45:08 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> The ZForwardingTest gtest first reserves memory via the ZGC APIs to do so and then uses the generic `os::commit_memory(...)` to commit the memory. That is problematic on Windows because the two APIs are not compatible there. I've updated the test to use ZGC's APIs to commit and map memory instead.
>> 
>> Thanks to @roberttoyonaga for finding this and helping out diagnosing this issue!
>> 
>> The patch also adds some tiny fixes to the assert code that mislead me while prototyping this.
>> 
>> I'll run this through tier1 testing.
>
> test/hotspot/gtest/gc/z/zunittest.hpp line 140:
> 
>> 138: 
>> 139:       char* mem = (char*)os::malloc(sizeof(ZPhysicalMemoryBacking), mtTest);
>> 140:       _backing = new (mem) ZPhysicalMemoryBacking(max_capacity);
> 
> Should we call `create_backing` here instead?

Ahh, thanks. These are left-overs from an earlier version. I'll fix this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29471#discussion_r2738588149


More information about the hotspot-gc-dev mailing list