JEP proposed to target JDK 13: 350: Dynamic CDS Archives

Ioi Lam ioi.lam at
Wed May 1 19:51:51 UTC 2019

On 5/1/19 12:02 PM, Michael Bien wrote:
> Thank you very much for the detailed explanation Jiangli and Ioi.
> On Wed, May 1, 2019 at 6:53 PM Ioi Lam <ioi.lam at> wrote:
>> The dynamic archive can also be shared across processes running on the
>> same host, as long as they are running the same program.
>> So if you're running multiple copies of the same program, then using the
>> old method (single static archive) is roughly the same as the new method
>> (static archive + dynamic archive).
>> If your environment runs different programs that share the same set of
>> libraries. e.g.,
>>       2 processes running with "-cp:lib.jar:foo.jar FooApp"
>>       4 processes running with "-cp:lib.jar:bar.jar BarApp"
>> to achieve best sharing, you can create a static archive (using a
>> classlist) for only the classes in lib.jar (and any other system classes
>> used by these apps). Then, create two different dynamic archives, one
>> for the "foo" app, and the other for the "bar" app.
> Understood. My main confusion came from the fact that i thought that each
> FooApp process was supposed to create its own dynamic archive based on the
> last run of the program. But FooApp and BarApp should just have two
> different dynamic archives, not six (one for each process).
> Will -XX:ArchiveClassesAtExit=dynfoo.jsa skip archive creation if the file
> already exists? Or is this flag only intended for the initial setup run of
> a program?

Currently, the -XX:ArchiveClassesAtExit=dynfoo.jsa option works the same 
way as in the old "static dump" where you would specify -Xshare:dump 
-XX:SharedArchiveFile=xyz.jsa. If the file exists, it will be 
overwritten. So in this usage model, there's a distinct "setup" phase 
where you create the archive.

We are considering making the dynamic dumping more automatic in an 
future RFE.

- Ioi

>> This way, the static archive can be shared across all 6 processes, and
>> the dynamic archives can be shared among the processes running the same
>> program.
>> Thanks
>> - Ioi
>> On 5/1/19 8:27 AM, Michael Bien wrote:
>>> since each JVM process would create its own dynamic class data
>>> archive, on top of a static archive, i would assume that only the
>>> static archive would be shared between processes, while the dynamic
>>> archive would be mostly only beneficial for tuning startup time.
>>> Manually created static AppCDS archives on the other hand are fully
>>> shareable and can help with both, footprint and startup time.
>>> Would this be correct or is more sharing magic going on between those
>>> per-process archives?
>>> (i suppose you could just use the dynamic CDS feature once and use the
>>> dynamic archive just like it would be a second static & shareable
>>> archive)
>>> best regards,
>>> michael
>>> On 25.04.19 23:26, mark.reinhold at wrote:
>>>> The following JEP is proposed to target JDK 13:
>>>>     350: Dynamic CDS Archives
>>>> Feedback on this proposal from JDK Project Committers and Reviewers [1]
>>>> is more than welcome, as are reasoned objections.  If no such objections
>>>> are raised by 23:00 UTC on Thursday, 2 May, or if they’re raised and
>>>> then satisfactorily answered, then per the JEP 2.0 process proposal [2]
>>>> I’ll target this JEP to JDK 13.
>>>> - Mark
>>>> [1]
>>>> [2]

More information about the jdk-dev mailing list