WatersWorks

Blog archive

JDK 23 Arrives with AI, Performance, and Security Enhancements

Oracle announced the general availability of JDK 23 this week, a feature release with enhanced capabilities focused on cloud-native applications, enterprise performance, and the growing demands of AI.

Available now, this release of the Java dev kit includes 12 new JDK enhancement proposals (JEPs), as well as thousands of smaller performance, stability, and security updates. It builds on its predecessors, of course, with updates in areas such as concurrency, memory management, and language simplicity, ensuring that Java—which just passed the three-decade mark—remains one of the most popular and widely-used programming languages in the world.

As part of Oracle's ongoing six-month release cycle, JDK 23 introduces a variety of key features aimed at improving both developer productivity and application performance. Highlights include the adoption of a new garbage collector (GC), enhancements for AI and machine learning integration, and improved security measures to safeguard applications against emerging threats.

Generational ZGC: Tackling Massive Data Sets
A standout feature of JDK 23 is the integration of the generational Z Garbage Collector (ZGC) as the default option. ZGC, designed to handle extremely large datasets, offers sub-millisecond pause times even when processing heaps that can stretch into terabytes of data. The generational mode further optimizes performance by separating young and old objects during garbage collection, which reduces the overall memory footprint and enhances application responsiveness.

"ZGC has become a highly reliable and predictable garbage collection mechanism for managing huge datasets with minimal latency," Chad Arimura, Oracle's VP of Developer Relations, told me on a Zoom call. "By introducing a generational mode, we've improved Java's efficiency for handling modern workloads like AI and large-scale data analytics."

This development is crucial as industries reliant on big data processing—such as AI, machine learning, and financial services—face growing performance demands. JDK 23's advancements in memory management make it an ideal solution for these environments, providing faster and more predictable performance.

AI and Modern Workloads: Project Loom and Panama
JDK 23 is also well-positioned to support the rising demand for AI and machine learning workloads, a priority for Oracle, Arimura said, not to mention the broader tech industry. The release builds on the work done under Project Loom, which introduces virtual threads to simplify concurrency and improve the performance of highly parallelized applications.

Project Loom enables Java developers to efficiently manage millions of virtual threads, making it easier to reason about complex concurrent applications. Structured concurrency, introduced as part of this project, allows developers to handle large-scale thread operations with greater predictability. This feature is especially relevant for AI workloads that demand high concurrency without compromising reliability.

Also, Project Panama continues to expand Java's ability to interoperate with foreign memory and foreign code. The Foreign Function and Memory API simplifies interactions with native languages like C, facilitating easier integration of machine learning frameworks such as TensorFlow. Panama also includes a vector API, designed to enhance performance in tasks such as numerical computation, which are critical to AI applications.

"Java has always been a platform for building large-scale, enterprise-grade applications," Arimura said, "but with these enhancements, it's also now one of the best platforms for AI and machine learning."

Language Improvements: Project Amber and Simpler Code
JDK 23 introduces new features under Project Amber, which focuses on making the language more concise and easier to use. As applications increasingly become data-driven, developers are looking for ways to write less verbose code without sacrificing performance or functionality.

One of the key improvements is the enhancement of records and pattern matching, which simplifies how developers handle and manipulate data in Java. These features allow developers to write more concise and readable code, making Java a viable option for smaller, data-focused applications as well as large enterprise projects.

Project Amber is also helping Java compete with newer, "trendier" languages, such as Python and Go, which are often chosen for their simplicity in AI and cloud-native environments. The improvements brought by Amber give Java developers more flexibility in writing quick scripts and "glue code," allowing them to remain within the Java ecosystem without resorting to other languages.

"Many developers still think of Java as a language for large, heavy applications, but the truth is, Java has evolved tremendously over the past decade," Donald Smith, Senior Director of Product Management at Oracle, said during that Zoom call. "Project Amber's focus on language simplicity makes Java more competitive in areas where Python and Go have traditionally dominated, especially in AI and cloud-native development."

Security and Platform Integrity
Security continues to be a major focus in JDK 23, with Oracle making significant progress in platform integrity. One key initiative is the gradual removal of access to internal APIs that have long been used by developers but were never meant for public use. By restricting access to these APIs, Oracle aims to create a more secure platform and encourage developers to use newer, safer alternatives.

JDK 23 includes enhanced support for the Panama memory segment API, which allows developers to interact with native memory in a secure and controlled manner, reducing the risk of security vulnerabilities such as buffer overflows. Oracle has also emphasized the continued development of its module system, ensuring that public APIs are clearly defined, and internal APIs are protected.

Platform integrity remains a crucial area for Oracle as it seeks to maintain Java's position as a secure, stable, and scalable platform. "With Java 23, we've made significant progress in ensuring platform integrity," said Bernard Traversat, VP of Software Development at Oracle, who was also on the Zoom call, "which is essential as we evolve the platform without breaking compatibility with existing applications."

New Tools for Developers: Graal JIT and Visual Studio Code Integration
In a notable shift, JDK 23 introduces the Graal Just-In-Time (JIT) compiler as an option within the Oracle JDK. The Graal JIT offers faster startup and warm-up times, especially for applications that generate large amounts of garbage early in their execution. This addition gives developers more flexibility in optimizing their applications based on workload requirements.

Previously, developers had to download a separate version of the Graal JDK to take advantage of the Graal JIT. Now, the JIT can be enabled with a simple command-line flag, streamlining the development process and making it easier for developers to experiment with different configurations.

JDK 23 also sees continued investment in making the language more accessible to new developers. Oracle's Visual Studio Code plugin, which has recently surged in popularity, now supports the latest JDK in real-time, allowing developers to access new features as they are released. This feature has helped bridge the gap between experienced Java developers and newer entrants to the field, ensuring that Java remains a popular choice among learners and hobbyists.

A Platform Built for the Future
As Java enters its fourth decade, Oracle's focus remains on balancing innovation with stability. The company's "tip and tail" model ensures that developers who want the latest features can access them through the regular six-month release cadence, while those who prioritize long-term stability can continue to rely on Long-Term Support (LTS) releases. The next LTS version, Java 25, is expected next year.

"Java is not the same language it was 10 years ago," Arimura said. "We've spent the past several years refining and modernizing the platform to ensure it meets the needs of today's developers. Whether you're building AI applications, working with big data, or just maintaining a legacy system, Java 23 has something for you."

In Additional Awesome News
Oracle will host a series of events and webinars over the coming months to help developers familiarize themselves with Java 23's new features. A JavaOne conference is also scheduled for March 2025 in California (yea!), marking the first independent event since JavaOne was folded into Oracle's CloudWorld conference. More info on the homecoming of that venerable devcon here.

Posted by John K. Waters on September 18, 2024