Backend Development 18 min read

Unlock Faster Java: Oracle GraalVM Native Image’s Startup, Memory, and Throughput Gains

Oracle GraalVM’s new release for JDK 17 and JDK 20 adds free‑to‑use native‑image features—including profile‑guided optimizations, G1 GC, object‑header compression, ML‑driven PGO, and SBOM support—delivering up to 46% faster startup, 2‑3× lower memory usage, and up to 1.6× higher peak throughput compared with traditional JIT, while also introducing new tooling such as native‑image bundles, build reports, enhanced AWT support, and experimental monitoring.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
Unlock Faster Java: Oracle GraalVM Native Image’s Startup, Memory, and Throughput Gains

1. Oracle GraalVM

Oracle GraalVM is a new GraalVM distribution for JDK 17 and JDK 20 released under the GraalVM Free Terms and Conditions (GFTC) license, allowing free use of all GraalVM features in development and production.

Native Image in this version adds the following features:

Profile‑guided optimization and additional compiler optimizations for peak performance

G1 GC for large‑heap, low‑pause applications

Compressed object headers and pointers for reduced memory footprint

Machine‑learning‑driven type inference

Additional security features supporting SBOM

Performance tests on a Java 20 Spring PetClinic sample compare Oracle GraalVM Native Image with GraalVM CE Native Image and GraalVM CE with C2 JIT. The benchmark runs on an Oracle X5‑2 server (Intel Xeon E5‑2699 v3) with 16 CPU cores and a 1 GB max heap, using wrk to generate 600 requests/s for 100 seconds and measuring peak throughput over 180 seconds.

Key results:

Startup speed is 46.42 % faster than GraalVM CE Native Image and 32 × faster than JIT.

Memory usage is 25 % lower than GraalVM CE Native Image and 2.52 × lower than GraalVM CE with C2 JIT.

Peak throughput is 1.6 × higher than GraalVM CE, though still slightly below JIT for this workload.

Requests per GB per second reach 14 780, roughly double the CE Native Image and C2 JIT.

Latency remains below 3 ms for the 95th percentile, with Native Image offering better P99 latency than JIT.

2. GraalVM Built for JDK 17 and JDK 20

GraalVM now follows a naming scheme matching the JDK version, offering GraalVM for JDK 17 and GraalVM for JDK 20. Both are based on the main branch and include the new features. Users are encouraged to migrate to JDK 20. Native Image is now bundled with the JDK download, eliminating the need for a separate component.

Install native‑image with:

gu install native-image

Download Oracle GraalVM for Linux x86‑64 JDK 20 with:

<code>wget https://download.oracle.com/graalvm/20/latest/graalvm-jdk-20_linux-x64_bin.tar.gz</code>

3. Machine‑Learning‑Based Compilation Optimizations

Profile‑guided optimization (PGO) now uses a pre‑trained ML model to predict branch probabilities, improving runtime performance by about 6 % on benchmarks such as Renaissance and DaCapo. The ML‑driven profiles are enabled by default, though they may increase the native executable size by 1‑2 %.

4. Higher‑Performance Native Image

A new

-march

option lets users choose between compatibility and native performance:

-march=compatibility

for maximum compatibility

-march=native

for optimal performance on the same architecture

-march=list

to list supported architectures

Additional PGO improvements include merging multiple profiling runs with

native-image-configure

, a new sampling profiler that records call stacks, a context‑aware inliner that reduces executable size by 2‑7 % and boosts peak performance, and enhanced loop vectorization that brings AOT performance close to JIT.

5. Native Image Bundles

Native Image Bundles allow the creation of a bundle containing the application JAR, parameter settings, environment variables, class‑path and module‑path options. Use the

--bundle-create=.nib

flag to generate a

&lt;imagename&gt;.nib

file and an

&lt;imagename&gt;.output

directory. Reproduce the build with:

native-image -bundle-apply=…/path/to/&lt;imagename&gt;.nib

6. Build Reports

Native Image can now generate an HTML build report (

-H:+BuildReport

) that includes build environment information, reachable types, fields and methods, a full code and heap region breakdown, and a software bill of materials (SBOM).

7. AWT Support on Linux

Native Image now supports AWT on Linux in addition to Windows, enabling more GUI Java applications to run as native executables.

8. Native Image Development Experience

Improved memory usage during the build process, allowing larger applications to be compiled.

Automatic setup of the Windows build environment, removing the need for the x64 Native Tools command prompt.

Extended JFR support for events

ExecutionSample

,

ObjectAllocationInNewTLAB

, and

JavaMonitorInflate

.

Safer metadata composition to avoid build breakage.

More user‑friendly error reports with guidance on how to file issues.

LLVM backend now supports GraalVM Native Image on RISC‑V.

9. New Native Image Monitoring Features

Experimental JMX remote management can be enabled with

--enable-monitoring=jmxclient,jmxserver

.

10. Getting Started with Native Image

A curated list of over 150 libraries and frameworks verified to work with Native Image (e.g., Micronaut, Spring, Quarkus, Helidon, H2, GraphQL, MariaDB, Netty, MySQL, Neo4j, PostgreSQL, Testcontainers, Thymeleaf) is available on graalvm.org and integrated with the GraalVM‑reachability‑metadata repository and Native Build Tools.

11. GraalVM JDK and Compiler Updates

GraalVM JIT now supports ZGC, a low‑latency garbage collector (not yet supported in Native Image).

Ideal Graph Visualizer (IGV) is being open‑sourced as a developer tool for analyzing compilation graphs.

12. Community Contributions

Nearly 200 community contributions to the graalvm‑reachability‑metadata repository.

Collaboration with Red Hat on JFR support, Windows debugging improvements, and experimental JMX support.

Feedback, benchmarks, and issue reports continue to drive each GraalVM release.

13. GraalVM Ecosystem Updates

GraalVM ecosystem survey report released.

Spring Boot 3.0 supports Native Image.

Quarkus 3 introduces new Dev UI features.

Micronaut 4 will baseline on Java 17 with faster builds.

Azure Application Insights can monitor GraalVM and Spring Boot applications.

Testcontainers integrates with GraalVM Reachability metadata for Native Image testing.

Independent performance study comparing GraalVM and OpenJDK C2 published.

Kafka, Quarkus, and GraalVM experiments show low‑latency proxy nodes.

machine learningJava performanceGraalVMnative-imageProfile Guided OptimizationJDK20
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.