RFR: 8363986: Heap region in CDS archive is not at deterministic address [v2]
Ioi Lam
iklam at openjdk.org
Fri Nov 14 07:07:08 UTC 2025
On Wed, 5 Nov 2025 22:55:25 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
>> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>>
>> - clean up of old C++ class name ArchiveHeapWriter
>> - @ashu-mehra comment -- simplified the criteria for _is_writing_deterministic_heap
>> - Merge branch 'master' into 8363986-heap-region-in-aot-cache-not-determinitic-address
>> - More clean up
>> - fixed aot map
>> - clean up
>> - 8363986: Heap region in CDS archive is not at deterministic address
>
> src/hotspot/share/cds/archiveHeapWriter.cpp line 96:
>
>> 94: guarantee(MIN_GC_REGION_ALIGNMENT <= G1HeapRegion::min_region_size_in_words() * HeapWordSize, "must be");
>> 95:
>> 96: if (CDSConfig::old_cds_flags_used() && !CDSConfig::is_dumping_aot_linked_classes() && UseG1GC) {
>
> Wouldn't it be better to add a VM command line flag to indicate that deterministic dump is needed, and use that flag in `Images.gmk`, instead of relying on these conditions?
Since determinism is required only for the old CDS workflow, which will probably be deprecated soon, I think we should avoid adding new VM flags.
I have updated the code to use always set `_is_writing_deterministic_heap = true` when using the old CDS workflow. This avoid coupling with the makefiles, and should have minimal impact with the users of old CDS archives. In some cases, runtime relocation might always happen (e.g., G1 with large heaps), but the cost of relocation is usually small (less than 1ms).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28052#discussion_r2526047723
More information about the hotspot-runtime-dev
mailing list