2022 was a very productive year for the GraalVM project and community. Together, we developed many new features, released GraalVM for the latest Java versions and new platforms, and saw several new interesting use cases of GraalVM.
Let’s look at the highlights of this year!
Aligning GraalVM with OpenJDK
Earlier this year at JavaOne we announced that applicable portions of GraalVM’s Java technology will be contributed to OpenJDK. This will help us more closely align with the OpenJDK development process, and help drive the adoption of GraalVM for users and partners by aligning release schedules, features, and licenses. One of the practical outcomes will be that GraalVM will have two feature releases per year, four CPU releases, and an LTS release every two years.
As one of the next steps in this direction, we introduced project Galahad, whose objective is to contribute Java-related GraalVM technologies to OpenJDK.
Read more about the release cadence change and project Galahad in a related blog post.
Supporting the latest JDK versions
As of the 22.3 release, GraalVM provides builds for the latest Java version, 19, so you can use the latest Java and GraalVM features together. This means that you can for example use virtual threads from project Loom with GraalVM (be sure to enable support by passing
-- enable-preview), or use
jwebserver and even compile these applications with Native Image.
Faster, lighter, and more user-friendly Native Image builds
Native Image moves the overhead of code analysis and compilation to the build step, which enables fast startup and memory savings, but comes at a cost of increased build times and resources. We’ve been working to reduce those requirements over the past few releases. Now, with GraalVM 22.3 JDK19, for example on my pretty standard machine (a 16GB Macbook Pro), a HelloWorld compiles to native in just 16.2s, and a decent-sized Micronaut web application — in 1m 26s. 🎉
By popular demand, the build process also got lighter — starting with 22.2, Native Image can successfully build many larger native executables with only 2 GB of Java heap. This is particularly beneficial in memory-constrained environments like Docker containers or GitHub Actions.
The new Native Image build output that we all know and love, breaking down the build process into stages and sharing helpful stats about it, was also first introduced this year in GraalVM 22.0.
GraalVM Reachability Metadata Repository
During the build process, Native Image compiles only the code that is reachable from your application’s main entry point. To include elements that Native Image deems unreachable, you have to provide Native Image with metadata (configuration information). The metadata can be automatically provided by a library or framework, or created manually, for example, with the help of the tracing agent. To simplify this task further, earlier this year we introduced the GraalVM Reachability Metadata Repository — a centralized repository for the community to share and reuse metadata for Native Image. We are actively working on this repository together with the community. At the moment, it includes metadata for more than 30 commonly used projects, such as Hibernate, Tomcat, Testcontainers, various database connectors, and more.
Learn how to get started with the reachability repository as well as contribute to it in the related blog post.
GitHub Action for GraalVM
We also released the GitHub Action for GraalVM, which makes it easy to set up and use GraalVM (Community and Enterprise), Native Image, and Truffle languages and tools. Now it’s being used by more than 600 projects!
New Compiler Optimizations
We’ve added several compiler optimizations which benefit both JIT and AOT compilation, such as a new loop rotation optimization, new strip mining optimization for counted loops, loop vectorization for integer min/max operations, global value numbering for fixed nodes early in the compilation pipeline, as well as improved performance of a type switch in Native Image, and reduced memory usage in JIT mode by releasing the unused memory back to the system once the application reaches a stable state.
Native Build Tools
Native Build Tools, GraalVM’s Maven and Gradle plugins for Native Image, added several features and improvements, in particular, added integration with the metadata reachability repository and completely reworked agent support in Gradle.
Native Build Tools also support automatic discovery of Native Image metadata via the reachability metadata repository — you just need to enable access to it in your
GraalVM on Apple Silicon 🚀
Builds for this platform were one of the most requested features on our GitHub, so we are happy that now those are available as well. Apple Silicon users can use all several GraalVM components such as the JDK, Native Image, GraalVM languages and tools, and benefit from fast compilation times.
Developer experience improvements
Throughout the year we’ve also made many improvements in the developer experience of Native Image and other GraalVM components:
- The base GraalVM download got significantly smaller — now it’s just around 250MB and contains the JDK and tooling for Java development; you can install additional components, such as Native Image and GraalVM languages, with one command via
- You can also download the GraalVM JDK with Native Image included for use on your machine or in CI/CD pipelines with a one-line command — read about it in the related blog post or try at graalvm.org/downloads.
- We added support for jvmstat to Native Image, and, together with Red Hat, extended the JFR support and started to work on JMX support. All of this enables JVM-style monitoring performance and resource consumption of native executables at run time.
- Reduced the file size of the GraalVM Native Image installable from ~120 MB to ~30 MB (note that
native-image-llvm-backendis now an optional component).
- It’s now possible to create heap dumps in native executables, and there are multiple ways to do it: by using the
-XX:+DumpHeapAndExitcommand line option, sending the
USR1signal, or programmatically via the
- GraalVM Enterprise Native Image can now embed a Software Bill of Materials (SBOM) at build time to detect any libraries that may be susceptible to known security vulnerabilities;
- Debugging support on Linux and Windows got improved thanks to contributions from Red Hat;
To get an overview of the latest major Native Image features and options, take a look at the Native Image quick reference.
In addition to the shorter name, the GraalVM Python runtime got startup time improvements, switched by default to a new bytecode interpreter for even faster startup and better interpreter performance, and added and extended support for several packages such as
pytest, and others.
GraalPy now supports Flask! It’s a micro web framework with features such as a development server and debugger, support for unit testing, extensions, and more.
Also, the Raspberry Pi supercomputer at Oracle CloudWorld used GraalPy to run the Python code 8x faster!
Our team was also actively contributing to HPy, a new C API for Python, that offers a nice new API, binary compatibility across Python versions and implementations, and evolvability. For example, read about how we ported Matplotlib from C API to HPy.
Expect more exciting updates from GraalPy in 2023!
Community and Ecosystem
GraalVM is an open-source project, and we are grateful to have an amazing community of people that actively participate in the project, contribute, share feedback and help us improve GraalVM.
In September, we organized the second GraalVM Community Workshop in Zurich. Together with community members and partners, we discussed several important topics, such as the project roadmap and governance, recent and upcoming features, improving library compatibility with Native Image, Truffle and GraalVM languages, and other topics. We are grateful to all participants for their feedback and plan to organize such a meetup every year.
We also added a public roadmap for GraalVM on GitHub. Now you can see in one place what we are working on at the moment, and what can be expected in upcoming releases. Check out the roadmap here.
Spring Boot 3.0 with support for GraalVM Native Image went GA!🎉 It’s the first Spring Boot release with full support for Native Image. To get started, just go to start.spring.io and add “GraalVM Native Support” as a dependency. For an overview of the AOT and Native updates in Spring Framework 6.0 and Spring Boot 3.0, check out this presentation by Stéphane Nicoll and Brian Clozel.
Micronaut added Test Resources for easy testing against external dependencies (for example via Testcontainers) in both JIT and Native Image modes.
The Helidon team introduced Helidon Nima, a microservices framework based on virtual threads, which works great on Native Image as well — give it a try here.
Red Hat released several new versions of Quarkus to support the latest GraalVM releases, and contributed to debugging and monitoring in Native Image.
Also, JUnit 5.9.1 added new
DisabledInNativeImage annotations for testing native executables built with GraalVM.
We also saw several new interesting use cases of GraalVM:
- Disney Streaming are using GraalVM and Micronaut for super fast serverless Java;
- Adyen are safely running C/C++ code in the Java space with GraalVM;
- Several cloud vendors now have support for Native Image in their libraries and SDKs: OCI SDK for Java, Azure GraalVM Netty Support client library for Java, Amazon SDK for Java, and Google Cloud Libraries;
- GraalVM Enterprise can now be used directly in OracleCloud DevOps build pipelines, as well as OCI Code Editor and Cloud Shell.
- JHipster added a new
jhipster-nativeblueprint, which enables easy bootstrapping of fully-blown web applications that are also very fast thanks to GraalVM. The
jhipster-nativeblueprint is using Spring Boot, but you can use Micronaut and Quarkus with JHpister and GraalVM;
- HPI students compiled the Minecraft server to native with GraalVM;
- Stepstone embedded Doom in Java with GraalVM WASM;
- We also saw GraalVM being used to speed up deep learning workloads;
- Michiel Borkent from the Clojure community shared his experience using Native Image to create a fast scripting environment for Clojure.
The GraalVM community also got its own mascot — expect to see more of Grabbit in 2023!🐰
We are also grateful to the community for every contribution and every piece of feedback that help us improve GraalVM for everyone.
Unfortunately, this year didn’t go without sad news. The GraalVM and Ruby community lost Chris Seaton, who started TruffleRuby and worked with us for many years at Oracle Labs. He continued sharing his knowledge and helping community members later on when working on TruffleRuby at Shopify. Our deepest condolences to Chris’s family and friends.
See you in 2023!🎄
We are already working on new exciting features that you will see in 2023. If you have feedback or suggestions for us, feel free to share them via Slack, GitHub, Twitter, or Mastodon (and most importantly, fill out our developer survey!).
Thank you all for being a part of the amazing GraalVM community, happy holidays, and see you all in 2023!
— the GraalVM team