Withdrawn: Workaround CacheDataStore use with source launcher

Aleksey Shipilev shade at openjdk.org
Fri Sep 20 07:37:03 UTC 2024


On Fri, 6 Sep 2024 08:51:57 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> I was trying to test the simplest workload that involves javac, and that is source launcher. When I attempt to use source launcher with `-XX:CacheDataStore`, it fails with:
> 
> 
> $ rm -f app.cds*; build/linux-x86_64-server-release/images/jdk/bin/java -XX:CacheDataStore=app.cds -Xmx256m -Xms256m -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC HelloStream.java
> [0.001s][warning][cds] optimized module handling/full module graph: disabled due to incompatible property: jdk.module.addmods=ALL-DEFAULT
> Error occurred during initialization of VM
> CacheDataStore cannot be created because AOTClassLinking is enabled but full module graph is disabled
> 
> 
> Source launcher adds `--add-modules=ALL-DEFAULT`:
> 
> 
> $ man java
> ...
>        In source-file mode, execution proceeds as follows:
> 
> ...
>        • The compiled classes are executed in  the  context  of  an  unnamed  module,  as  though  --add-mod‐
>          ules=ALL-DEFAULT  is  in  effect.  This is in addition to any other --add-module options that may be
>          have been specified on the command line.
> 
> 
> I think we can work that around specifically for Leyden, and also leave a TODO breadcrumb in the code that we need to figure this out on CDS side. This PR does that workaround. With it, source launcher works with simple examples:
> 
> 
> $ build/linux-x86_64-server-release/images/jdk/bin/java -XX:CacheDataStore=app.cds -Xmx256m -Xms256m -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC  HelloStream.java
> Warning: CacheDataStore cannot be used with default source launcher environment, disabling --add-modules=ALL-DEFAULT
> hello, world

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/leyden/pull/15


More information about the leyden-dev mailing list