Announcing Oracle GraalVM for JDK 21

September 19, 2023 | 4 minute read
Text Size 100%:

Oracle is pleased to announce the availability of Oracle GraalVM for JDK 21. This release brings with it new Java 21 features, improvements in Native Image performance, simplified usage of embedded languages, and more.

Project Loom Virtual Threads

First previewed in JDK 19, Project Loom is no longer a preview feature in JDK 21. GraalVM for JDK 21 implements Loom’s virtual threads when running on the JVM and when using Native Image.

Native Image Performance

While executables generated by GraalVM Native Image may be best known for their quick startup time, metrics such as memory usage, peak throughput, and latency are also critically important. With Oracle GraalVM for JDK 21 we see ahead-of-time (AOT) compilation achieving superior results on all metrics when benchmarking the popular Spring PetClinic application. While some developers might expect that JIT compilation would always outperform AOT compilation, the throughput achieved by Native Image generated executables in GraalVM for JDK 21 provide competitive peak performance.

All the following Spring PetClinic benchmark results were obtained with a maximum heap size of 512MB. The two configurations compared below are: a native executable produced by Oracle GraalVM for JDK 21 optimized with profile guided optimization (PGO); the same application running on GraalVM Community Edition for JDK 21 using the C2 JIT compiler. Both configurations use the G1 garbage collector.

Startup (seconds): Native 97% faster

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)




Memory Usage (RSS in MB): Native 38% lower

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)




99th Percentile Latency (ms): Native 28% lower

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)




Throughput (requests/second): On par

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)



With these latest results, we can see that Oracle GraalVM Native Image can provide faster startup time, reduced memory requirements, and lower latency while maintaining throughput making it an ideal choice for microservices, functions, and other workloads where minimizing operating cost is critical.

New Container Images

To support container-based application development and deployment, new container images are available for the Oracle GraalVM JDK and Native Image in the Oracle Container Repository. The `jdk` image can be used to deploy Java applications while the `native-image` container image includes all the tools required to compile applications into native executables.

Faster Compile Times

To reduce application compile times, some optimization phases that were previously included in the default level 2 (-O2) have been moved to a new level 3 (-O3). The level 3 optimizations work best with profile guided optimization, so they are automatically enabled when compiling with `--pgo`. The result is faster default compilation times with no significant impact on application performance. PGO continues to employ the same optimizations as in previous releases.

During development, where the focus is on functionality, not performance, developers can continue to use the “quick build” option (-Ob) to reduce compile times. This option disables most memory and performance optimizations so the resulting executables are not recommended for production deployments.


The new Oracle GraalVM release provide the latest JDK 21 features along with advanced ahead-of-time compilation with GraalVM Native Image. With across-the-board improvements in all performance metrics, Oracle GraalVM for JDK 21 is ideal for microservices and other cloud workloads. Get started at

Oracle GraalVM is free to use on Oracle Cloud Infrastructure and is included in Oracle Java SE Subscription products. 

Shaun Smith

Shaun Smith leads product management of Oracle Lab's GraalVM.

Previous Post

To celebrate Oracle CloudWorld, Oracle Press is offering a 40% to 70% discount on select materials

Lisa Goldstein | 1 min read

Next Post

The Arrival of Java 21

Sharat Chander | 13 min read