To improve start-up time, especially on systems with ASLR, we should try to mmap the CDS archive to an alternate address (chosen by the OS). 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).
======
In our testing environment, we have a fairly small number of mapping failures (below 1%), so I don't think the performance degradation caused by relocation matters too much. However, now that we can guarantee that CDS is always enabled, we can do more optimizations. E.g., AOT-compiled code can now have references into the CDS data and can assume that it's always available. So hopefully CDS can be used as a basic building block for future optimization work.
- blocks
-
JDK-8225638 [lworld] Store inline classes in CDS archive
- Resolved
-
JDK-8233093 Move CDS heap oopmaps into new MetaspaceShared::bm region
- Resolved
- duplicates
-
JDK-8262922 Randomise mapped CDS address and relocate pointers by default
- Closed
- relates to
-
JDK-8236847 CDS archive with 4K alignment unusable on machines with 64k pages
- Resolved
-
JDK-8243506 SharedBaseAddress is ignored by -Xshare:dump
- Resolved
-
JDK-8277241 java -Xshare:on document needs to be updated
- Resolved
-
JDK-8231986 Consolidate parts of the Linux and MacOSX versions of ps_core.c
- Resolved
-
JDK-8232069 Enable CDS even when UseCompressedClassPointers and/or UseCompressedOops are false
- Resolved
-
JDK-8263131 reduce unnecessary downwards search when using linear search to find method
- Closed
-
JDK-8241824 "assert(old_ptr != 0) failed: bits for NULL pointers should have been cleaned at dump time" on windows 32bit
- Open
-
JDK-8234133 VM build broken due to memory/archiveUtils.inline.hpp: No such file or directory
- Resolved
-
JDK-8234324 ARM32 build broken after 8231610
- Resolved
-
JDK-8234196 [TESTBUG] DynamicArchiveRelocationTest.java missing "ArchiveRelocationMode == 1 ...."
- Resolved
-
JDK-8241158 SA TestHeapDumpForInvokeDynamic.java fails when CDS archive is relocated
- Resolved
-
JDK-8234735 InstanceKlass:find_method_index regression after JDK-8231610
- Resolved
-
JDK-8235563 [TESTBUG] appcds/CommandLineFlagComboNegative.java does not handle archive mapping failure
- Resolved
-
JDK-8262922 Randomise mapped CDS address and relocate pointers by default
- Closed