RFR(L) 8231610 Relocate the CDS archive if it cannot be mapped to the requested address

Ioi Lam ioi.lam at oracle.com
Fri Oct 11 00:58:37 UTC 2019


Bug:
https://bugs.openjdk.java.net/browse/JDK-8231610

Webrev:
http://cr.openjdk.java.net/~iklam/jdk14/8231610-relocate-cds-archive.v01/

Design:
http://cr.openjdk.java.net/~iklam/jdk14/design/8231610-relocate-cds-archive.txt


Overview:

The CDS archive is mmaped to a fixed address range (starting at
SharedBaseAddress, usually 0x800000000). Previously, if this
requested address range is not available (usually due to Address
Space Layout Randomization (ASLR) [2]), the JVM will give up and
will load classes dynamically using class files.

[a] This causes slow down in JVM start-up.
[b] Handling of mapping failures causes unnecessary complication in
     the CDS tests.

Here are some preliminary benchmarking results (using default CDS archive,
running helloworld):

(a) 47.1ms (CDS enabled, mapped at requested addr)
(b) 53.8ms (CDS enabled, mapped at alternate addr)
(c) 86.2ms (CDS disabled)

The small degradation in (b) is caused by the relocation of
absolute pointers embedded in the CDS archive. However, it is
still a big improvement over case (c)

Please see the design doc (link above) for details.

Thanks
- Ioi



More information about the hotspot-runtime-dev mailing list