-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b06
For example, a program needs to be started by a script like this:
if test ! -f foo.jsa; then
java -XX:ArchiveClassesAtExit=foo.jsa -cp foo.jar Foo
else
java -XX:ShareArchiveFile=foo.jsa -cp foo.jar Foo
fi
However, even this won't handle the case when you upgrade your JDK. So the script will need to do JDK version checking as well. This makes it inconvenient to use CDS.
To improve usability, we should allow the CDS archive to be automatically generated if necessary (e.g., if the specified archive doesn't exist, or if it's out of date because you have updated the JDK).
Perhaps we can have a new JVM options like this:
java -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=foo.jsa -cp foo.jar Foo
If foo.jsa doesn't exist, or if it was generated for a different version of the JDK, DynamicDumpSharedSpaces will be enabled automatically, and foo.jsa will be created when the Java process exits. When the app is launched again, it will be able to use foo.jsa.
This can be built on top of the facilities added by
- csr for
-
JDK-8272331 Automatically generate the CDS archive if necessary
- Closed
- duplicates
-
JDK-8246643 Add a "use or create" like feature to CDS
- Closed
-
JDK-8275846 read_base_archive_name() could read past the end of buffer
- Resolved
- is blocked by
-
JDK-8273152 Refactor CDS FileMapHeader loading code
- Resolved
- relates to
-
JDK-8279997 check_for_dynamic_dump should not exit vm
- Resolved
-
JDK-8287869 -XX:+AutoCreateSharedArchive doesn't work when JDK build is switched
- Resolved
-
JDK-8280353 -XX:ArchiveClassesAtExit should print warning if base archive failed to load
- Resolved
-
JDK-8293955 Document the option XX:+AutoCreateSharedArchive
- Resolved
-
JDK-8279970 two AppCDS tests fail after JDK-8261455
- Closed
-
JDK-8296754 AutoCreateSharedArchive in JDK 20 is not compatible with JDK 19
- Resolved
-
JDK-8259070 Add jcmd option to dump CDS
- Resolved
- links to
-
Commit openjdk/jdk/1228b2f1
-
Review openjdk/jdk/5077
-
Review openjdk/jdk/5997
-
Review openjdk/jdk/6920