Repository navigation
Conversation
The language server holds millions of small objects, and compact object headers made its heap 6% smaller on castle fight (488 to 457 MB after a collection) at the same start time. The runtime of the distribution carries the base CDS archive for that mode (wurstscript/WurstScript#1389), and a JVM uses a base archive only for the header mode it runs with, so the mode is also part of what the AppCDS archive next to the compiler jar is named after. The option is passed before wurst.javaOpts, so an entry there can still switch it off; the server then starts without an archive, which the end-to-end test covers.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…le who already have it in wurst.javaOpts
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Closing: the shipped JRE is being upgraded to 27 by another change, which makes this unnecessary. |
What
Starts the language server with
-XX:+UseCompactObjectHeaders(a product flag since JDK 25). The server holds millions of small objects, and on castle fight the heap after a full GC went from 488 to 457 MB (−6%) at the same start time (three interleaved starts each, ready after 21.1 s vs 20.7 s median).Companion to wurstscript/WurstScript#1389, which makes the distribution's runtime ship the base CDS archive for that header mode (
classes_coh.jsa). A JVM uses a base archive only for the header mode it runs with, so:getServerOptionspasses-XX:+UseCompactObjectHeadersbeforewurst.javaOpts; an entry there (-XX:-UseCompactObjectHeaders) still switches it off.appCdsJvmOptions(java, jar, jvmOptions)takes the options the server starts with and names the AppCDS archive after the effective header mode too, so a switched-off server never meets an archive written in the other mode.People can already put
-XX:+UseCompactObjectHeadersintowurst.javaOpts; this makes it the default. Having it in both places is the same mode, so the server runs with the option twice and uses the same archive (the JVM takes the last of repeated options; covered by both tests below).With a runtime that has no
classes_coh.jsa(every release before #1389) the JVM runs as it did: the option is valid, there is just no archive to share.Checks
node scripts/test-appcds.js(unit): the effective-mode rule (last option wins), the archive name per mode, and the existing cases. Removing the mode from the archive name makes it fail.node scripts/test-lsp-appcds.js <jar> <java>against the distribution built from #1389: first session writes the archive, the second starts from it and leaves it, an updated jar gets a new archive, a server with the option also injavaOpts(so given twice) starts from the same archive and ends cleanly, and a server with-XX:-UseCompactObjectHeadersinjavaOptsstarts and ends cleanly without one.tsc --noEmitis clean.