Proposal: Replace -XX:CacheDataStore with new "AOT" naming scheme

ioi.lam at oracle.com ioi.lam at oracle.com
Thu Aug 15 21:57:07 UTC 2024


Hi folks,

I've filed https://bugs.openjdk.org/browse/JDK-8338476 to rename 
-XX:CacheDataStore.

Any comments? Without any strong objections I will implement this shortly.

Thanks

- Ioi

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

As part of JEP 483, we are adding new -XX:AOTXxx flags (see JDK-8338017) 
for controlling ahead-of-time optimizations. The -XX:CacheDataStore flag 
in the leyden/premain should be renamed to be consistent with the new 
naming scheme.

Also, -XX:CacheDataStore=foo has automagic behavior -- if foo exists, 
load it as the CDS archive; otherwise create foo at VM exit. While such 
automagic behavior might be convenient for desktop users, it's not 
particular useful for early adopters of Leyden -- i.e., developers who 
are packaging apps for cloud deployment. For example, to make sure that 
foo is created, you would need to remove it explicitly:

     rm -f foo
     java -XX:CacheDataStore=foo -cp app.jar ...

Proposal:

In JEP 483, AOTConfiguration is required for creating an AOTCache. E.g.,

     java -XX:AOTMode=create -XX:AOTCache=foo.aot \
         -XX:AOTConfiguration=foo.aotconfig \
         -cp app.jar ...

In the leyden/premain branch, we allow the AOTConfiguration flag to be 
omitted. In this case, the application will be executed once and the 
AOTCache will be created at VM exit:

     java -XX:AOTMode=create -XX:AOTCache=foo.aot \
         -cp app.jar ...

Also, in this mode, all Leyden optimizations (such as 
-XX:+StoreCachedCode) are enabled by default (this is the same behavior 
as with -XX:CacheDataStore).



More information about the leyden-dev mailing list