OpenJDK Projects That We Anticipate

Transcript

The Java platform is in full bloom. There are many projects in the OpenJDK that aim to improve Java in some way. Some of them are already integrated or getting integrated such as Project Loom. Some of them are ripening, and their integration is just around the corner. Let’s look at four OpenJDK Projects that we all look forward to.

Leyden

Java applications can take several minutes to warm up and reach peak performance. Plus, they have a bigger CPU and memory footprint during the warm up. Project Leyden will improve these issues. The project aims to achieve this by shifting and constraining some computations from the production run to some earlier stage, for instance, to the training run. The shifting, constraining, and optimizing transformations will be applied in the form of condensers. A condenser transforms program code without breaking the compatibility with the Java Platform Specification. When the application runs in production, it reuses this already compiled code, and so the startup and warmup will be faster. Project Leyden will use Application Class Data Sharing, Ahead-of-time compilation, and additional techniques that will allow the transformation and reuse of the application code. Early-access builds of Project Leyden are already available! At this stage, the project observes application behavior during the trial run and performs certain computations. Then, it creates a CDS archive with class metadata, method profilers, and some compiled code. If you want to try Early-Access builds of Project Leyden with your application, I wrote a step-by-step guide on how to do that, the link is in the description. 

Valhalla

Project Valhalla aims to improve the performance of Java applications by bridging the gap between the Java programming model and modern hardware capabilities. Java is based on the object-oriented model, so if there’s no available primitive type for some data, it is natural to use objects. But creating and fetching objects is costly. So, Project Valhalla will offer a solution in the form of value objects, primitive classes, and specialized generics. Value objects have a value and behavior just like all other Java objects, but they don’t have identity, which distinguishes one object from another and helps to create mutable objects and perform some identity-sensitive operations like comparing two objects for equality by reference. But identity requires that an object resides in one place and has a pointer. A value object without identity must be immutable, but in turn, the JVM can freely copy and re-encode it, which leads to optimized memory usage. Primitive classes combine the benefits of primitives and objects. Their objects can have fields and methods, but these objects are just sequences of non-static fields and behave like primitives at runtime. Generics specialization will enable the developers to use generics with primitive types and value objects without breaking backward compatibility. All these enhancements will enable the JVM to produce more memory-efficient data structures, bringing the performance of Java applications to a new level. Early-access builds are available for experiments.

Babylon

Babylon Project will help to transform Java code to foreign programming models such as GPUs, machine learning models, and so on. This will be done by improving Java reflection capabilities with so-called code reflection. Code reflection means developers can write code models in Java that can be accessed at compile time or at runtime. These models can be transformed by Java itself to fit some other programming model. For instance, a Java program can be transformed into a GPU kernel or emulate Language Integrated Queries (LINQ) of C#. Project Babylon is at the early stages of development, but you can explore project documentation.

Lilliput

Project Lilliput will reduce the size of Java object headers. All Java objects have headers, which consist of a header word and a class pointer. HotSpot JVM headers take up 128 bits on 64-bit architectures. This Project aims to reduce their size to 64 bits and eventually to 32 bits if possible. This will help to improve memory footprint and CPU usage of Java applications thanks to the reduced heap usage.

Summary

OpenJDK is actively evolving, with projects like Leyden, Valhalla, Babylon, and Lilliput aiming to enhance Java's performance and capabilities. Leyden focuses on faster startup and warmup by reusing precompiled code, while Valhalla introduces value objects, primitive classes, and specialized generics for better memory and runtime efficiency. Babylon seeks to enable Java-to-foreign model transformations, and Lilliput reduces object header sizes to optimize memory and CPU usage, all contributing to Java's growth and versatility.

About Catherine

Java developer passionate about Spring Boot. Writer. Developer Advocate at BellSoft

Social Media

Videos
card image
Dec 17, 2024
Master Java Profiling: Tools, Techniques, and Real-World Tips

Java profiling allows to rapidly identify and fix performance bottlenecks in your program. In this video we explain what is profiling, introduce popular profiling tools, list their pros and cons, and provide useful tips and code examples.

Videos
card image
Dec 9, 2024
How to use CRaC with Spring Boot in a Docker Container

CRaC (Coordinated Restore at Checkpoint) is an OpenJDK project designed to significantly reduce startup and warmup times of Java applications to milliseconds. This tutorial demonstrates using CRaC with a Spring Boot application running in a Docker container, specifically the Spring Boot Petclinic app (version 3.2 or later).

Further watching

Videos
card image
Jan 22, 2025
JEP 483: Ahead-of-Time Class Loading & Linking. Project Leyden in JDK 24

JEP 483 introduces Ahead-of-Time (AOT) Class Loading and Linking in JDK 24, which enhances Java application startup times by loading and linking classes ahead of time and storing them in a reusable AOT cache. This feature, part of Project Leyden, reduces the JVM's workload during startup without requiring changes to application code, though a training run mimicking production is needed to create an efficient cache. Early tests with a Spring Boot app showed significant improvements, cutting startup time from two seconds to just one second.

Videos
card image
Jan 14, 2025
How to use AppCDS with Spring Boot

This tutorial demonstrates how to use Application Class Data Sharing (AppCDS) and Ahead-of-Time (AOT) processing with Spring Boot applications to reduce startup time by 40–50%. AppCDS creates an archive of parsed classes for faster loading, requiring no code changes, and works both locally and in containers. The tutorial covers building optimized Docker images using Dockerfiles or Buildpacks for efficient deployment and improved performance.

Videos
card image
Dec 28, 2024
JDK 24: The New Features in Java 24

JDK 24 is in Rampdown Phase One, which means, we know all the JEPs targeted to this release. And there are a lot of them, so it is time to discuss this new Java release!