# Building Class Data Sharing Archives with Apache Maven

DevFeed: [Building Class Data Sharing Archives with Apache Maven](<https://devfeed.tech/articles/building-class-data-sharing-archives-with-apache-maven-18799.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/building-class-data-sharing-archives-with-apache-maven/>)

Published: 2020-06-11T15:30:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Maven](<https://devfeed.tech/topics/maven.md>), [Java](<https://devfeed.tech/topics/java.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [apache](<https://devfeed.tech/tags/apache.md>), [build](<https://devfeed.tech/tags/build.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [memory](<https://devfeed.tech/tags/memory.md>), [performance](<https://devfeed.tech/tags/performance.md>)

## AI overview

This tutorial explains how class data sharing (CDS) and dynamic AppCDS archives can improve Java application startup times and reduce memory usage. It shows how to create AppCDS archives automatically as part of an Apache Maven build and notes that Java 13 or later is required for the described approach.

## Source excerpt

Table of Contents Manually Creating CDS Archives Using the CDS Archive Creating CDS Archives in Your Maven Build What Do You Gain? Wrap-Up Ahead-of-time compilation (AOT) is the big topic in the Java ecosystem lately: by compiling Java code to native binaries, developers and users benefit from vastly improved start-up times and reduced memory usage. The GraalVM project made huge progress towards AOT-compiled Java applications, and Project Leyden promises to standardize AOT in a future version of the Java platform. This makes it easy to miss out on significant performance improvements which have been made on the JVM in recent Java versions, in particular when it comes to faster start-up times. Besides a range of improvements related to class loading, linking and bytecode verification, substantial work has been done around class data sharing (CDS). Faster start-ups are beneficial in many ways: shorter turnaround times during development, quicker time-to-first-response for users in coldstart scenarios, cost savings when billed by CPU time in the cloud. With CDS, class metadata is persisted in an archive file, which during subsequent application starts is mapped into memory. This is faster than loading the actual class files, resulting in reduced start-up times. When starting multiple JVM processes on the same host, read-only archives of class metadata can also be shared between the VMs, so that less memory is consumed overall.