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

ioi.lam at oracle.com ioi.lam at oracle.com
Fri Aug 16 17:00:01 UTC 2024


On 8/15/24 3:21 PM, Vladimir Kozlov wrote:
> java -XX:AOTMode=create -XX:AOTCache=foo.aot -cp app.jar ...
>
> This is for one step workflow.
>
Mark suggested that we shouldn't rely on the lack of an argument 
(AOTConfiguration) to trigger a new behavior. Instead, he suggested

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

which I think is a good idea.

> For 5 steps workflow (which we still support for development) we may 
> need all flags from JEP. Or it is different RFE?
>
I think we should just deprecate (and remove) the 5 step workflow.

Thanks

- Ioi


> Vladimir K
>
> On 8/15/24 2:57 PM, ioi.lam at oracle.com wrote:
>> 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