RFR: 8363986: Heap region in CDS archive is not at deterministic address [v2]
Vladimir Kozlov
kvn at openjdk.org
Tue Nov 18 19:11:13 UTC 2025
On Fri, 14 Nov 2025 07:03:44 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> 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).
Please, no new flags if we can avoid
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28052#discussion_r2539362325
More information about the hotspot-runtime-dev
mailing list