Status of AppCDS

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Status of AppCDS

August Nagro
Hello,

Both Class Data Sharing (CDS) [1] and AppCDS [2] are very interesting but
seemingly neglected features of the Java Platform, offering the ability to
reduce startup time.

Class Data Sharing is the global cache stored in
/lib/[arch]/server/classes.jsa, and circumvents long class-loading times by
caching the JVM’s internal representation of system jars and memory-mapping
them in during startup. The feature's documentation [1] has been updated
for Java 9, but I have yet to see a JDK or JRE installation that can use it
without manually generating the archive. In every case I've encountered,
the file needs to first be created (and given appropriate access
permissions) with admin access, and then generated by `java -Xshare:dump`.

AppCDS extends the same feature to user libraries. It works well, but has
been experimental since (before?) JDK 8 and is commercial.

Java has been criticized for its slow startup times. Improvements would
enable command line utilities, the realistic use of JShell .jsh scripts
(currently takes >4 seconds for hello world on my Mac [3]), and other
applications. I'm not sure how *CDS concerts with other OpenJDK efforts
like AOT compilation, but it offers the advantage of architecture
independency and the ability to be shared across multiple JVMs.

Is *CDS doomed for deprecation, or will it be improved? Without work to CDS
or changes to AppCDS, the current state is not very usable.

Regards,

August Nagro

[1]: https://docs.oracle.com/javase/9/vm/class-data-sharing.htm
[2]:
http://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-31503FCE-93D0-4175-9B4F-F6A738B2F4C4

[3]:
Executing command `jshell helloworld.jsh`, with file containing
```
System.out.println("hello world");
/exit
```