Oracle released GraalVM for JDK 22, internally versioned 24.0. Aligned with the recent release of Java 22, GraalVM for JDK 22 supports most of the JDK Enhancement Proposals (JEPs) delivered in Java 22.
Generational ZGC, available since JDK 21, is not yet supported for Just In Time compilation, but targeted for version 24.1. The Vector API is supported for Graal JIT, but improvements are ongoing. Support for the Vector API in Native Images is in progress, but not yet available. The Foreign Function and Memory API became generally available in JDK 22, but is not yet supported in Native Images.
GraalVM for JDK 22 will receive updates for six months until GraalVM for JDK 23 is released.
Project Galahad, a new project introduced in December 2022, proposes to contribute Java-related GraalVM functionality to the OpenJDK Community for a possible incubation in the JDK. As part of the preparation, the Graal JIT compiler now uses the jdk.graal
prefix, instead of the graal
prefix which is now deprecated.
The equals()
and hashCode()
methods for Java records now use intrinsified method handles to improve the performance of records in Native Images.
Starting with this release, all classes are now allowed to be used and initialized at build time by default. This pull request describes the details and provides several examples.
Oracle now provides a buildpack for Spring boot applications by configuring the spring-boot-maven-plugin:
<image>
<buildpacks>
<buildpack>docker.io/paketobuildpacks/oracle</buildpack>
<buildpack>urn:cnb:builder:paketo-buildpacks/java-native-image</buildpack>
</buildpacks>
</image>
Profile Guided Optimizations (PGOs) improve native image performance, however it might be challenging to collect a good profile. The new experimental option -H:+PGOPrintProfileQuality for the Native Image build produces a line in the build output report section of Inlining Methods to show the quality of the profile. This blog post by Boris Spasojević, principal researcher at Oracle, provides more information about Profile Guided Optimizations for Native Image.
Native Image Build Reports contain information about the build process and the generated binary files. Profiling information may now be visualized as a flamegraph when providing the -H:+BuildReport and -H:+BuildReportSamplerFlamegraph options when building a PGO optimized native executable with the option --pgo and the name of the profiles file.
Experimental support for the Foreign Function and Memory API, may be enabled with the -H:+ForeignAPISupport option and currently supports downcalls for the x64 architecture.
The reference manual provides more details about Foreign Function and Memory API in Native Image.
Version 24.0 of the Truffle languages is compatible with GraalVM for JDK 22 and GraalVM for JDK 21, the latest Long Term Support (LTS) version. In the future, new versions of the Truffle languages will be compatible with the latest GraalVM JDK and the latest GraalVM JDK LTS, but might require the latest minor JDK version. This blog post by Alina Yurenko, developer advocate for GraalVM at Oracle Labs, describes the latest changes in JavaScript and Node.js, GraalPy, and TruffleRuby.
Oracle provides binaries for all supported platforms. Next to that, it's possible to install Oracle GraalVM via SDKMAN!, Homebrew, or the yum package manager on Oracle Cloud Infrastructure VM instances. Alternatively, Oracle GraalVM may be used in GitHub Actions, Paketo Buildpacks for Spring applications or with container images from the Oracle Container Registry to run Java applications or using GraalVM Native Image in order to compile applications ahead of time. The Oracle GraalVM documentation provides more information about Getting Started.
The open-source alternative, GraalVM for JDK 22 Community 22.0.0, is available on GitHub, SDKMAN! and Chocolatey.
More information about the release might be found in the blog post by Alina Yurenko. Next to that, there's a release Stream available on YouTube where Alina Yurenko and Fabio Niephaus, researcher on the GraalVM team at Oracle Labs, discuss the latest release.
The complete list of changes for this release can be found in the release notes.