From bb65595bb3662277088085a987ac2fe50495afc7 Mon Sep 17 00:00:00 2001 From: RobinDM Date: Thu, 17 Oct 2024 21:01:35 +0200 Subject: [PATCH] Update appcds.adoc Mention the appcds.use-container flag --- docs/src/main/asciidoc/appcds.adoc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/src/main/asciidoc/appcds.adoc b/docs/src/main/asciidoc/appcds.adoc index db08254f2cc41..c3cf8afc63708 100644 --- a/docs/src/main/asciidoc/appcds.adoc +++ b/docs/src/main/asciidoc/appcds.adoc @@ -14,9 +14,11 @@ 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 @@ -24,7 +26,7 @@ The main downside of creating AppCDS manually for an application is that their g 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 @@ -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.