Repository navigation
Conversation
… flags the wheel starts with (#313) jlink makes a JRE without a class-data-sharing archive. scripts/dump_cds_archive.sh dumps the JVM's default archive as the last step of the JRE build (Docker and the native macOS and Windows builds), with -XX:+UseCompactObjectHeaders as jvm.py sets it, and checks it with -Xshare:on. The AOT cache stays opt-in. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #313 (the CDS archive half; the AOT cache stays opt-in, as the issue plans). Part of #315 and the glue changes of the wheels-only 26.11.1.post1. For users: the JVM wheel's bundled JRE now ships a class-data-sharing archive, so the JVM maps the JDK's classes at start instead of loading and verifying them. No value, API or flag changes. The wheel grows by the size of the archive (below).
What changes:
jlinkbuilds a JRE without a CDS archive (the issue found no.jsain the wheel and-Xsharenever set). A newscripts/dump_cds_archive.shdumps the JVM's default archive as the last step of the JRE build, inDockerfile.build(Linux) and inbuild-native.sh(macOS and Windows, which build on their own hosts), after the module and library clean-up and before the JRE is copied into the package. It dumps with-XX:+UseCompactObjectHeaders, the flagsrc/arcadedb/jvm.pysets at every start: the JVM ignores, without an error, an archive dumped with another setting of it. It also dumps with-Xmx1gso compressed oops are on whatever the RAM of the build host is, and then runsbin/java -Xshare:on -versionwith the same flags, which fails the build when the archive cannot be used.Loading: I use the JVM's own default archive location and
-Xshare:auto(the JVM default) instead of an explicit-XX:SharedArchiveFile, so there is no flag forstart_jvmto add and nothing to get wrong on a path. The JVM looks for the archive by itself and goes on without it when it is missing or was dumped for other settings, and the dump and the start name the same file because they run the same JVM with the same flags.aot.pyis untouched: it still treats a user's-Xshareor-XX:SharedArchiveFileas the user's decision. Two limits, both a start without the archive as before: a heap above 32 GB (jvm.py gives the JVM half of the RAM, so a machine with more than 64 GB of RAM) uses another archive name that is not dumped, and the archive holds the JDK's classes only (the engine's jars are checked by absolute path and mtime in an archive, which an installed wheel cannot match). A new paragraph ininstallation.adocsays so.Memory: I did not measure it. The archive is mapped, not copied, and it is read-only shared pages, so I expect idle RSS to move, but that is a claim for the later measurement, not a result here.
Tests (
tests/test_jvm_cds.py, JVM wheel only, run in every platform and Python leg oftest-jvm.yml, Windows and macOS included, on the installed wheel at its install path): the wheel holds a.jsafile; the bundled JVM with the exact argumentsstart_jvmbuilds starts with-Xshare:on, and-Xlog:class+loadshowsjava.lang.Object source: shared objects file; a JVM with-XX:-UseCompactObjectHeaderscannot use the archive with-Xshare:onand starts without it with-Xshare:auto, which pins the coupling to the flag in jvm.py. I could not run any of it or the build here (CI only); the evidence is the runs listed below. I did not runtest-native.ymlfor this PR: it changes only the JVM wheel's build and tests.No speed claim: the measurement is a later laptop A/B (cold first read and idle RSS, the method of the issue), and the untimed profile studies queued for tonight.
🤖 Generated with Claude Code