Java class data sharing upgrade would boost startup times

OpenJDK plan would improve support for archived Java heap objects in class data sharing, aligning with the Project Leyden effort to improve startup performance.

speed fast race car shutterstock 1168856884
Jamesboy Nuchaikong / Shutterstock

Efforts to improve Java program startup times and performance are set to include improving support for archived Java heap objects in CDS (class data sharing).

The plan, made public by Ioi Lam of Oracle in an OpenJDK community RFC last month, aligns with Project Leyden, an effort to improve startup times for Java applications as well as times to peak performance and program footprints. Lam noted that Project Leyden is likely to make extensive use of archived Java heap objects.

Goals of the CDS improvement plan include uniform support of CDS for all collectors and minimizing the code needed for each collector to support CDS. CDS itself is intended to reduce application startup times, in particular for smaller applications. CDS is supported only with the Java HotSpot client VM and only with the serial garbage collector.

The CDS improvement plan calls for:

  • Removing the G1 garbage collector dependency for writing the archive heap; a working prototype already has been developed.
  • Consolidating the archive heap into a contiguous block. The intent is to make it easy to mmap (memory map) the archive heap into different collectors. Removal of G1 archive region types also is planned as part of this step.
  • Implementation of mmap of the archive region for other collectors. The implementation is expected to be fairly simple.

As of Java Development Kit (JDK) 20, which is due as a production release in March, implementers of the plan must deal with limitations including CDS archive dumping only being supported by the G1 collector, G1 having a special allocation routine for space in the heap, and mmap supported only in G1.

Providing the impetus for the CDS proposal was a Java development plan to have uniform APIs for using archived regions. That proposal was launched this past November.

Copyright © 2023 IDG Communications, Inc.