Application Class-Data Sharing (AppCDS) is a JVM feature that reduces launch times, response time outliers, and memory footprint by archiving class data once and reusing it across JVM launches. On Java 12+, a JDK-class archive is included and enabled by default. On Java 13+, dynamic AppCDS lets the JVM automatically create an application-class archive at shutdown using -XX:ArchiveClassesAtExit. For Java 10/11, the process requires three manual steps: dumping a class list with -XX:DumpLoadedClassList, creating the archive with -Xshare:dump and -XX:SharedArchiveFile, then launching with -XX:SharedArchiveFile. A key constraint is that the class path used at launch must have the archive's class path as a prefix, and wildcards or exploded JARs cannot be used when creating the archive. Real-world testing on a large desktop app showed a ~20% (3-second) reduction in a 15-second launch time.

14m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ Application Class-Data Sharing In A Nutshell▚ Working With A JDK Class-Data Archive▚ Working With An Application Class-Data Archive▚ Reflection

Sort: