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

Thomas Stuefe stuefe at openjdk.java.net
Tue Feb 23 17:32:41 UTC 2021


On Tue, 23 Feb 2021 17:09:37 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> How about changing the code to
> 
> ```
>   if (DumpSharedSpaces) {
>     _core_region_alignment = (size_t)os::vm_allocation_granularity();
> #if (defined(LINUX) && defined(AARCH64)) || defined(__APPLE__)
>     // If you create a CDS archive on one machine, and use it on another, and the two
>     // machines have different page sizes, make sure the archive can be used
>     // on both machines.
>     // 
>     // (a) Linux/aarch64 can be configured to have either 4KB or 64KB page sizes.
>     // (b) macOS/x64 uses 4KB, but macOS/aarch64 uses 64KB (note: you can run an x64 JDK
>     //     on an M1-based MacBook using Rosetta).
>     if (_core_region_alignment < 64*K) {
>       log_info(cds)("Force core region alignment to 64K");
>       _core_region_alignment = 64*K;
>     }
> #endif
>   } else {
> ```

Yes. Good comments too.

I guess on Windows this does not matter, since allocation granularity is 64k anyway?

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

PR: https://git.openjdk.java.net/jdk/pull/2651


More information about the hotspot-runtime-dev mailing list