Efforts to enhance Java program startup occasions and efficiency are set to incorporate bettering help for archived Java heap objects in CDS (class data sharing).
The plan, made public by Ioi Lam of Oracle in an OpenJDK community RFC final month, aligns with Project Leyden, an effort to enhance startup occasions for Java functions in addition to occasions to peak efficiency and program footprints. Lam famous that Challenge Leyden is prone to make in depth use of archived Java heap objects.
Objectives of the CDS enchancment plan embrace uniform help of CDS for all collectors and minimizing the code wanted for every collector to help CDS. CDS itself is meant to cut back software startup occasions, specifically for smaller functions. CDS is supported solely with the Java HotSpot shopper VM and solely with the serial rubbish collector.
The CDS enchancment plan requires:
- Eradicating the G1 rubbish collector dependency for writing the archive heap; a working prototype already has been developed.
- Consolidating the archive heap right into a contiguous block. The intent is to make it straightforward to mmap (reminiscence map) the archive heap into completely different collectors. Elimination of G1 archive area varieties is also deliberate as a part of this step.
- Implementation of mmap of the archive area for different collectors. The implementation is predicted to be pretty easy.
As of Java Development Kit (JDK) 20, which is due as a manufacturing launch in March, implementers of the plan should take care of limitations together with CDS archive dumping solely being supported by the G1 collector, G1 having a particular allocation routine for house within the heap, and mmap supported solely in G1.
Offering the impetus for the CDS proposal was a Java growth plan to have uniform APIs for using archived regions. That proposal was launched this previous November.