Pre-RFR 8236847 CDS archive with 4K alignment unusable on machines with 64k pages

Ioi Lam ioi.lam at
Wed Jan 29 05:37:23 UTC 2020

Hi Dmitry,

Here's a proposal to make it possible to generate CDS archives that can 
be used on machines with different OS page alignments: generate the CDS 
archive with

      java -Xshare:dump -XX:SharedRegionAlignment=64k

I want to be conservative, as this seems to affect only Linux/aarch64, 
so I have limited the range of this flag to be no more than 64KB. You 
can see checks for other invalid values in the new test case.

If SharedRegionAlignment is not specified (as for most platforms), 
os::vm_allocation_granularity() will be used.

For simplicity, -XX:SharedRegionAlignment can only be set when dumping 
the base archive (-Xshare:dump). The dynamic archive 
(-XX:DynamicDumpSharedSpaces) will always use the value as stored in the 
base archive.

Please let me know if this solution will work for your situation. If so, 
I will file a CSR for the new flag and also write more test cases.

(Also, the default CDS archive is created at JDK build time. I'll leave 
it to the ARM porting folks to do the makefile changes to pass the
-XX:SharedRegionAlignment=64k flag to BUILD_CDS_ARCHIVE in Images.gmk)

- Ioi

More information about the hotspot-runtime-dev mailing list