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
Oct 24, 2024
5 Tips for Optimizing Java Performance on Kubernetes

If your Java apps in the cloud struggle with high resource consumption, frequent container restarts, or slow response times, these five tips can help enhance their performance. First, set CPU and RAM limits properly based on load testing and account for Kubernetes overhead.

Videos
card image
Oct 21, 2024
Why Test Performance When Scaling K8s

Running the HotSpot JVM in containers requires careful tuning of resource limits, garbage collection, and JVM options to maximize performance and avoid issues like container restarts or poor scaling.

Further watching

Videos
card image
Nov 22, 2024
Reducing Java Startup Time: 4 Approaches

Java application startup can be significantly accelerated using modern tools. AppCDS stores preloaded classes in a shared archive, cutting startup time by up to 50%, while Project Leyden shifts optimizations to earlier stages with ahead-of-time compilation. GraalVM Native Image creates standalone executables for sub-second startup, and CRaC restores pre-warmed application states for instant readiness.

Videos
card image
Nov 15, 2024
Boost The Performance and Security of Your Spring Boot App with Alpaquita Containers

Alpaquita Containers offer a secure, high-performance solution for running Spring Boot applications in the cloud. These lightweight containers, built on Liberica JDK Lite and Alpaquita Linux, optimize memory and disk usage, reducing resource consumption by up to 30%.

Videos
card image
Nov 1, 2024
An Overview of Java Garbage Collectors

Java provides multiple garbage collectors (GCs) tailored to different performance needs. Serial GC is ideal for single-threaded apps but pauses all threads, while Parallel GC uses multiple threads to prioritize throughput.