-
Enhancement
-
Resolution: Fixed
-
P3
-
11
-
b22
- Improve the usability of application class data sharing (AppCDS). Eliminate the need for users to do trial runs to create a classlist for each application.
- Support both builtin class loaders and customized class loaders effectively and uniformly.
Dynamic archiving for a given application can done at the first execution of the application or when requested by users via command-line option, -XX:ArchiveClassesAtExit=<dynamic archive>. For example:
% bin/java -XX:ArchiveClassesAtExit=<dynamic archive> -cp hello.jar HelloWorld
Currently, the command line option approach is being implemented.
* The dynamically genarated archive is created on top of the default system archive packaged with the running JDK binary. A separate top-layer archive file is generated for each different Java application. User can specify the application's archive name/path using the -XX:ArchiveClassesAtExit=<dynamic archive> option.
* If desired by user, the system archive can be ignored and all system classes (including the ones in the system archive) loaded during the application execution are archived into the dynamically created archive file. In that case, only one archive (the dynamic archive) is in effect. This behavior can be achieved via a new command-line option, and can be implemented after the initial integration.
* As the dynamically created top layer archive has dependency to the base archive (e.g. pointers to base layer data), the CRC values of the base archive header and all shared spaces are recorded in the top layer. At runtime, when the dynamic archive is mapped in, all recorded CRC values are compared with the currently mapped base archive CRC values. If any of the CRC value mismatches, the dynamic archive is disabled without affecting the use of the currently used base archive. Using CRC values for base archive dependency checking is more robust than the file name, size and timestamp checks.
* The memory lay-out in the top-layer dynamic archive is similar to the existing static archive that's created using a classlist. Metadata is separated into following three spaces. No 'md' or 'od' space needed.
- rw space: Read-writable data
- ro: Read-only data
- mc: Trampoline
The shared spaced are mapped individually at runtime. The 'ro' space is mapped as read-only for sharing.
* Currently archiving (copying and relocating metadata) is done at the end of the application execution and before VM exiting. If a user defined class loader and associated classes are unloaded, those classes are not archived. Following is a solution for user defined class loaders that is planned after the initial integration:
Copying/relocating of the class metadata can be done immediately after loading a requested class (or before unloading).
* All loaded application classes and library classes (excluding the ones already included in the base layer and the ones that cannot be archived) are archived in the top-layer.
* Only class metadata is archived in the top layer currently. Archiving java heap objects in the top-layer dynamically requires more investigations and is not supported in initial implementation.
* Relocation of the archived java heap objects from the base layer (the default CDS archive) is done at dynamic archiving time, if the narrow oop encoding mode is different from the recoded mode in the base archive or if the archived heap regions are out of the current java heap range. As an optimization, the relocated java objects can be saved in the dynamic archive for subsequent use.
- csr for
-
JDK-8221706 Implement Dynamic CDS Archive
- Closed
- is blocked by
-
JDK-8213713 Minor issues during MetaspaceShared::initialize_runtime_shared_and_meta_spaces
- Resolved
-
JDK-8213346 Re-implement shared dictionary using CompactHashtable
- Resolved
- relates to
-
JDK-8224170 Build failures after JDK-8207812 (Implement Dynamic CDS Archive)
- Resolved
-
JDK-8211723 AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
- Resolved
-
JDK-8213346 Re-implement shared dictionary using CompactHashtable
- Resolved
-
JDK-8192921 Improve CDS support for custom loaders
- Closed
-
JDK-8200451 CDS dump time restricts to interpreter_only mode
- Closed
-
JDK-8202854 Hybrid archiving
- Closed
-
JDK-8224692 runtime/appcds tests crash in "HotSpotJVMCI::compute_offset" when running in Graal as JIT mode
- Resolved
-
JDK-8231606 _method_ordering is not set during CDS dynamic dump time
- Resolved
-
JDK-8232616 JVMCI_lock fails to get initialized when cds is disabled
- Resolved
-
JDK-8223287 Update java manpage for Application Class Data Sharing
- Resolved
-
JDK-8223077 module path support for dynamic CDS archive
- Resolved
-
JDK-8215311 JEP 350: Dynamic CDS Archives
- Closed
-
JDK-8222946 Refactor the archiving/copying code in dynamicArchive.[c/h]pp and metaspaceShared.[c/h]pp
- Closed
-
JDK-8223004 Avoid using a hard-coded number in SimpleCompactHashtable::calculate_header_size()
- Closed
-
JDK-8223072 Relax the ordering of archive file names in the -XX:SharedArchiveFile option
- Closed