RFR: 8338011: CDS archived heap object support for 64-bit Windows
Thomas Stuefe
stuefe at openjdk.org
Sat Aug 10 17:01:40 UTC 2024
On Sat, 10 Aug 2024 16:40:55 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> We didn't support CDS archived heap object on Windows because
>>
>> - The Windows implementation of `os::map_memory()` cannot map the contents of a file into a region that's already reserved by the garbage collector.
>> - We had a high failure rate for mapping the CDS archive on Windows due to ASLR, sometimes as high as 50%. So it didn't seem worth the effort (mainly testing) to support archived heap objects on Windows.
>>
>> Both of the above issues were fixed in [JDK-8231610](https://bugs.openjdk.org/browse/JDK-8231610), so we should add the support to Windows now.
>>
>> (Tested on Oracle CI tiers 1-7)
>
> src/hotspot/share/cds/filemap.cpp line 2181:
>
>> 2179: // for mapped region as it is part of the reserved java heap, which is already recorded.
>> 2180: char* addr = (char*)_mapped_heap_memregion.start();
>> 2181: char* base = map_memory(_fd, _full_path, r->file_offset(),
>
> So, do I understand this correctly, this always failed on Windows, since we attempt to map into the reserved region of the already existing Java heap?
No, wait, we never would have entered this path since `ArchiveHeapLoader::can_map()` is false on Windows.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20514#discussion_r1712673191
More information about the hotspot-dev
mailing list