Create CDS Archive for JVM app class pre-loading#154
Open
MirandaStreeter wants to merge 5 commits into
Open
Conversation
Signed-off-by: Miranda Streeter <miranda@mirandastreeter.com>
Member
|
LGTM, The ENV and LABEL which are now in the cds container will be kept when doing FROM in the final container? |
Contributor
Author
Yes, they're kept, they live in the |
MirandaStreeter
commented
Jun 25, 2026
Signed-off-by: Miranda Streeter <miranda@mirandastreeter.com>
Signed-off-by: Miranda Streeter <miranda@mirandastreeter.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description
It's possible to memory-map the JVM application classes (ie jruby, clojure, puppetserver, etc) instead of unpacking them from the jar files on startup. The base classes are already shipped with whatever JRE you run. Doing this for the application itself shaves ~10% of startup time in my testing (at the cost of ~100MB space). This uses an extra stage during the containerfile build steps.
See: https://docs.oracle.com/en/java/javase/21/vm/class-data-sharing.html
The hard part, and what made this take so long to work out, was figuring out why the SIGTERM handler wasn't cleanly shutting down the JVM. It was nothing to do with
dumb-initbehavior, and nothing to do with the Alpine container's busybox version ofpkill. No, we only need to target the child process, not the puppetserver wrapper that callsrunuser. And as an added bonus the shutdown seems to be faster as well. :)Part of #139
Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent