RFR: 8325132: CDS: Make sure the ArchiveRelocationMode is always printed in the log

Aleksey Shipilev shade at openjdk.org
Wed Mar 26 17:38:15 UTC 2025


On Tue, 25 Mar 2025 22:55:37 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> src/hotspot/share/cds/metaspaceShared.cpp line 1169:
>> 
>>> 1167:     dynamic_mapinfo = open_dynamic_archive();
>>> 1168: 
>>> 1169:     log_info(cds)("ArchiveRelocationMode = %d", ArchiveRelocationMode);
>> 
>> Looks like the style in adjacent output is `Archive relocation mode: %d`. How does the `-Xlog:cds` look with this change?
>
> With ArchiveRelocationMode = 0
> 
> [0.042s][info][cds] ArchiveRelocationMode = 0
> [0.042s][info][cds] Reserved archive_space_rs [0x0000000800000000 - 0x0000000801000000] (16777216) bytes
> [0.042s][info][cds] Reserved class_space_rs   [0x0000000801000000 - 0x0000000841000000] (1073741824) bytes
> [0.042s][info][cds] Mapped static  region #0 at base 0x0000000800000000 top 0x000000080055d000 (ReadWrite)
> [0.042s][info][cds] Mapped static  region #1 at base 0x000000080055d000 top 0x0000000800e05000 (ReadOnly)
> [0.042s][info][cds] _archived_main_module_name (null)
> [0.042s][info][cds] jdk.module.main (null)
> [0.042s][info][cds] optimized module handling: enabled
> [0.042s][info][cds] full module graph: enabled
> [0.042s][info][cds] jdk.module.addmods (null)
> [0.042s][info][cds] optimized module handling: enabled
> [0.042s][info][cds] full module graph: enabled
> [0.042s][info][cds] jdk.module.enable.native.access (null)
> [0.042s][info][cds] optimized module handling: enabled
> [0.042s][info][cds] full module graph: enabled
> 
> 
> With ArchiveRelocationMode = 1
> 
> [0.042s][info][cds] ArchiveRelocationMode = 1
> [0.042s][info][cds] Reserved archive_space_rs [0x0000000800000000 - 0x0000000801000000] (16777216) bytes
> [0.042s][info][cds] Reserved class_space_rs   [0x0000000801000000 - 0x0000000841000000] (1073741824) bytes
> [0.042s][info][cds] Mapped static  region #0 at base 0x0000000800000000 top 0x000000080055d000 (ReadWrite)
> [0.042s][info][cds] Mapped static  region #1 at base 0x000000080055d000 top 0x0000000800e05000 (ReadOnly)
> [0.042s][info][cds] _archived_main_module_name (null)
> [0.042s][info][cds] jdk.module.main (null)
> [0.042s][info][cds] optimized module handling: enabled
> [0.042s][info][cds] full module graph: enabled
> [0.042s][info][cds] jdk.module.addmods (null)
> [0.042s][info][cds] optimized module handling: enabled
> [0.042s][info][cds] full module graph: enabled
> [0.042s][info][cds] jdk.module.enable.native.access (null)
> [0.042s][info][cds] optimized module handling: enabled
> [0.042s][info][cds] full module graph: enabled
> [0.042s][info][cds] ArchiveRelocationMode == 1: always map archive(s) at an alternative address

Yeah, it's just the logging line just 3 lines earlier says: `Core region alignment: %zu`, so maybe match that?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23878#discussion_r2014680501


More information about the hotspot-runtime-dev mailing list