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
Jan 30, 2025
Dockerize Spring Boot Wisely: 6 tips to improve the container images of your Spring Boot apps

Your Spring Boot applications deserve a top-notch package!

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.

Further watching

Videos
card image
Feb 25, 2025
PF4J: Plugin Framework for Java. Plugin Systems for Backend

PF4J (Plugin Framework for Java) is a lightweight framework that allows developers to create modular applications using plugins. It enables the integration of custom code into applications through extension points, with support for lifecycle management and Spring integration for dependency injection. PF4J is useful for both desktop and web applications, offering flexibility in scaling and extending functionality without altering the core system.

Videos
card image
Feb 13, 2025
How to Profile Java Applications in Docker Containers with JFR

Java applications in Docker containers using Java Flight Recorder (JFR), a built-in OpenJDK tool. It covers three profiling methods: enabling JFR at application startup, attaching to a running container using an ephemeral container with jcmd, and monitoring real-time performance with JDK Mission Control via remote JVM connections.

Videos
card image
Feb 7, 2025
How to Create Dynamic SQL Queries with Spring Boot

Build SQL queries dynamically based on the user input with the Specification interface. Use the JPA Static Model Generator to create type-safe queries. Run the tests to check your application.