Skip to content

Start the language server with compact object headers - #156

Closed
Frotty wants to merge 2 commits into
masterfrom
compact-object-headers
Closed

Frotty wants to merge 2 commits into
masterfrom
compact-object-headers

Conversation

@Frotty

@Frotty Frotty commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

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:

  • getServerOptions passes -XX:+UseCompactObjectHeaders before wurst.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:+UseCompactObjectHeaders into wurst.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 in javaOpts (so given twice) starts from the same archive and ends cleanly, and a server with -XX:-UseCompactObjectHeaders in javaOpts starts and ends cleanly without one.
  • tsc --noEmit is clean.

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.
@Frotty

Frotty commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T13:03:13.682801Z ca489a8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: d16ff84bc9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@Frotty

Frotty commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: ca489a875e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@Frotty

Frotty commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Closing: the shipped JRE is being upgraded to 27 by another change, which makes this unnecessary.

@Frotty Frotty closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant