Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update appcds.adoc #43946

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions docs/src/main/asciidoc/appcds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ This reference guide explains how to enable Application Class Data Sharing in yo
== What is Application Class Data Sharing (AppCDS)?

link:https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#application-class-data-sharing[Application Class Data Sharing] is a JVM feature that helps reduce the startup time and memory footprint of a JVM application.
This is achieved by having the JVM create a pre-processed shared archived of classes that are loaded at startup time. As these classes
This is achieved by having the JVM create a pre-processed shared archived of classes that are loaded at startup time.
As these classes
are loaded every time the application starts, AppCDS is a conceptually simple way of improving the application startup time,
without the application itself having to be coded or configured in a specific way. How much of an improvement depends on many factors, such as the number of classes loaded, the underlying hardware etc.
without the application itself having to be coded or configured in a specific way.
How much of an improvement depends on many factors, such as the number of classes loaded, the underlying hardware etc.

== Vanilla AppCDS generation

The main downside of creating AppCDS manually for an application is that their generation requires launching the application with special flags and obtaining the archive in a step before the application is deployed to production.

NOTE: The exact process depends on the JVM version being used as newer JVM have incrementally made the process easier.

This fact makes the use of AppCDS difficult to use for real world deployments where a CI pipeline is responsible for building and deploying applications.
This fact makes AppCDS difficult to use for real world deployments where a CI pipeline is responsible for building and deploying applications.

== AppCDS in Quarkus

Expand Down Expand Up @@ -95,7 +97,11 @@ AppCDS has improved significantly in the latest JDK releases. This means that to

=== Usage in containers

When building container images using the `quarkus-container-image-jib` extension, Quarkus automatically takes care of all the steps needed to generate the archive
and make it usable at runtime in the container.
When building container images using the `quarkus-container-image-jib` extension, Quarkus automatically takes care of all the steps needed to generate the archive and make it usable at runtime in the container.

This way, by simply setting `quarkus.package.jar.appcds.enabled` to `true` the generated container can benefit from a slight reduction in startup time and memory usage.
This way, by simply setting `quarkus.package.jar.appcds.enabled` to `true`, containers using the generated image can benefit from a slight reduction in startup time and memory usage.

You may see that Quarkus starts a container to generate the AppCDS archive.
It does this to ensure that the Java version of the build align with that of the generated container image.
It is possible to opt out of this by setting `quarkus.package.jar.appcds.use-container` to `false`.
In that case, it is your responsibility to ensure that the Java version that will run the Quarkus application matches that of the machine building it.
Loading