Skip to content

Commit

Permalink
Update appcds.adoc
Browse files Browse the repository at this point in the history
Mention the appcds.use-container flag
  • Loading branch information
DeMol-EE authored Oct 17, 2024
1 parent 5c3944b commit bb65595
Showing 1 changed file with 12 additions and 6 deletions.
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.

0 comments on commit bb65595

Please sign in to comment.