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

Calvin Cheung ccheung at openjdk.org
Tue Mar 25 22:58:07 UTC 2025


On Tue, 25 Mar 2025 19:06:31 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Always include the ArchiveRelocationMode in the CDS info log. Before this fix, ArchiveRelocationMode is not in the log if it is set to 0.
>> The ArchiveRelocationMode default value was set to 1 about 2 years ago. Some tests need to be updated accordingly.
>> 
>> Testing:
>> 
>> - ran the modified tests manually on linux-x64
>> - tier1
>
> 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

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

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


More information about the hotspot-runtime-dev mailing list