The Graal team is pleased to announce the general availability of Oracle GraalVM for JDK 24. In addition to JDK 24 support and many smaller improvements, this release includes some exciting enhancements to Native Image ahead-of-time compilation to improve application performance and reduce the size of executables.
ML and AI-based Optimization
GraalVM Native Image compiles Java bytecode into native machine code to deliver incredibly fast startup times, lowered resource consumption, and improved security. Out of the box performance is great, but to achieve the best peak throughput one needs to compile with a performance profile.
Profile guided optimization (PGO) is a common technique used by traditional compilers for languages like C, Go, and Rust to optimize code at build time based on performance metrics gathered from one or more program executions. PGO typically involves:
- Initial program compilation
- Monitoring program execution with a given workload to generate profile data
- Program recompilation using profiling data to optimize “hot” code paths
GraalVM Native Image’s PGO support follows the traditional model. But GraalVM for JDK 20 introduced a novel new approach to generating a profile using machine learning (ML). Instead of running a program to generate a profile and then recompiling, developers can employ the GraalSP static profiler (built on the XGBoost machine learning library) which incorporates performance profile results from a wide range of applications. Even without user provided profile data, GraalSP improved out-of-the box performance by ~6% at no additional cost or effort on the Renaissance, DaCapo, and DaCapo con Scala benchmarks.
Now in GraalVM for JDK 24, Native Image includes GraalNN, a new Graph Neural Net-based static profiler that achieves a runtime speedup of ~7.9% on a wide range of microservice benchmarks—again without the need to profile an application and recompile!
GraalSP is enabled by default and when setting optimization level to -02. The new GraalNN static profiler is enabled when optimization level is set to -03. It is not enabled by default because it increases compilation time, which users should have an option to opt in to.
Research into static profiling with GraalNN at Oracle Labs is on-going and is expected to provide further performance improvements in future releases of Oracle GraalVM.
SkipFlow
In addition to innovative ML and AI powered optimizations, GraalVM for JDK 24 also includes a new experimental feature called SkipFlow that can reduce the size of executables and shorten compile times. SkipFlow does this by tracking primitive values and evaluating branching conditions during static analysis to eliminate code paths that traditional static analysis does not normally identify as unreachable. This can save compile time by avoiding analyzing and compiling unused code, and reduces executable size because less code is included.
On a wide range of benchmarks with SkipFlow enabled, Native Image produces executables that are ~6.3% smaller with no increase in compile time. In fact, compile times went down.
As this is new feature, it is classified as experimental and not enabled by default. To try it out on your applications, add the -H:+TrackPrimitiveValues and -H:+UsePredicates flags to your Native Image build. SkipFlow is planned to be enabled by default in GraalVM for JDK 25, the next release for which Oracle intends to provide long term support (LTS).
Summary
Oracle GraalVM for JDK 24 is a feature release that introduces a number of new cutting-edge Native Image compiler technologies including AI and ML profile guided optimization and advanced static analysis, which together improve application performance and reduce generated executable size. Release to release, GraalVM continues to incorporate the latest advancements in compiler engineering from Oracle Labs—with more yet to come!
Learn More
For technical details on the Oracle GraalVM for JDK 24 release, checkout the developer blog, the release notes, and the documentation.
To stay informed on the latest news you can follow GraalVM on BlueSky, X(Twitter), and LinkedIn.
Oracle GraalVM is included in the Oracle Java SE Subscription and is available at no additional cost for use on Oracle Cloud Infrastructure. Download the latest release today!
References
Milan Cugurovic, “GraalSP: Polyglot, efficient, and robust machine learning-based static profiler”, https://medium.com/graalvm/machine-learning-driven-static-profiling-for-native-image-d7fc13bb04e2
Lazar Milikic, Milan Cugurovic, and Vojin Jovanovic, “GraalNN: Context-Sensitive Static Profiling with Graph Neural Networks”, International Symposium on Code Generation and Optimization (CGO) 2025
David Kozak, Codrut Stancu, Tomáš Vojnar, and Christian Wimmer, “SkipFlow: Improving the Precision of Points-to Analysis using Primitive Values and Predicate Edges”, International Symposium on Code Generation and Optimization (CGO) 2025
