Wednesday, January 31, 2024

Announcing Oracle GraalVM for JDK 21

Announcing Oracle GraalVM for JDK 21

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) 
7.09 0.21 

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

GraalVM (C2 JIT) Oracle GraalVM Native Image (PGO+G1)
1029 641

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

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)
7.20 5.15

Throughput (requests/second): On par

GraalVM (C2 JIT)

Oracle GraalVM Native Image (PGO+G1)
11066 11902

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.

Source: oracle.com

Related Posts

0 comments:

Post a Comment