Skip to content

[GR-64282] Espresso CDS: Module layer caching. #11413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
Merged

Conversation

graalvmbot
Copy link
Collaborator

This PR implements a subset of the CDS (Class Data Sharing) functionality from HotSpot into Espresso.
Ironically, there's no class meta-data included in the file since the Espresso implementation aims to speed up the creation of the boot ModuleLayer. HotSpot's CDS is older than Espresso itself and has accumulated additional features over time, some of which be integrated as well into Espresso.

Espresso's static archive should be located by default in JAVA_HOME/lib/truffle/classes.ejsa.
It can be generated at build time with java -truffle -Xshare:dump.
Espresso maps HotSpot's -Xshare:on|off|auto|dump as --java.CDS=on|off|auto|dump.
Custom archive path can be set similar to HotSpot's -XX:SharedArchiveFile=<path/to/classes.jsa> using --java.SharedArchiveFile=<path/to/classes.ejsa>.

Additional logging can be enabled with --log.java.CDS.level=ALL -Djdk.module.boot.usePerfData=debug.

Simple tests for Espresso native-ee standalone, power save mode (slow, but more stable):
java -truffle -Xshare:off Hello 480ms
java -truffle -Xshare:on Hello 233ms (48%)
HotSpot for reference:
java -server -Xshare:off Hello 107ms
java -server -Xshare:on Hello 66ms (61%)

On Espresso JVM (cold):
espresso -Xshare:off Hello 5907ms
espresso -Xshare:on Hello 4838ms (81%)

Adopt HotSpot's -Xshare and -XX:SharedArchiveFile options for Espresso's CDS implementation.
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 16, 2025
@graalvmbot graalvmbot merged commit a01c22f into master Jun 16, 2025
13 checks passed
@graalvmbot graalvmbot deleted the module-layer-caching branch June 16, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants