22.3.0 / 25 October 2022
|Operating system||Linux, Windows and macOS|
|Platform||Java Virtual Machine|
|Type||Java dynamic compiler and runtime|
|License||Community Edition: GPLv2 Enterprise Edition: Trialware|
GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The first production-ready version, GraalVM 19.0, was released in May 2019. The most recent version is GraalVM 22.1.0, made available in April 2022.
Major differentiators of GraalVM compared to the base JDK are:
GraalVM has its roots in the Maxine Virtual Machine project at Sun Microsystems Laboratories (now Oracle Labs). The goal was to write a Java virtual machine in Java itself, hoping to free the development from the problems of developing in C++, particularly manual memory management, and benefit from meta-circular optimizations. Upon realizing that writing everything in Java was too ambitious as a first step, the decision was taken to focus on the compiler only and hook it into Hotspot, to reuse as much as possible the Hotspot runtime. The GraalVM compiler was started by manually converting the code of the Hotspot client compiler (named "C1") into Java, replacing the previous Maxine compiler.
Graal was included in HotSpot-based Java VM releases like OpenJDK from Java 9 through 15, in order to support experimental ahead-of-time compilation. The UseJVMCICompiler option also allowed JIT use as a C2 replacement. It was removed in Java 16 as maintaining both the version in the JDK and the standalone GraalVM release caused duplicate effort. A similar functionality to create native executables from Java projects is provided by the native-image tool of standalone GraalVM releases.
GraalVM is available as Community Edition for an open-source license and as Oracle GraalVM Enterprise Edition accessible by accepting the "OTN License Agreement Oracle GraalVM Enterprise Edition Including License for Early Adopter Versions". Oracle Corporation announced the release of Oracle GraalVM Enterprise Edition on 8 May 2019. GraalVM can substitute a default JDK on Linux and macOS platforms on x86 64-bit systems.
GraalVM 22.1.0 GraalVM 22.1.0 was released in April 2022.
GraalVM 22.0.0 GraalVM 22.0.0 was released in January 2022.
GraalVM 20.3.0 was released in November 2020. It was marked as the first LTS enterprise version of GraalVM and as the final release for 2020. This version supports code sharing in the GraalVM LLVM runtime, allowing the AST and compiled code of common bitcode libraries to be shared between multiple contexts within a single engine.
GraalVM 20.0.0 was released in February 2020. It improved in its Windows support, brought an enhanced native-image tool and improved the tooling support, among many detailed changes in the compiler and supported languages.
The support on Windows is currently under development and released as an early adopter functionality in GraalVM 19.0.
GraalVM 19.0 is based on top of JDK version 8u212.
The GraalVM Compiler is a modern Java just-in-time compiler. It complements or replaces the existing compilers (C1/C2 in HotSpot). In contrast to those existing compilers, the GraalVM compiler is written in modular, maintainable and extendable fashion in Java itself.
It is released under GPL version 2 with the classpath exception.
GraalVM Native Image is an ahead-of-time compilation technology that produces executable binaries of class files. It is released as an early adopter plugin, which means it is production-ready but may include backport incompatible updates in the future releases.
This functionality supports JVM-based languages, but can optionally execute dynamic languages, developed on top of GraalVM with Truffle framework. The executable file does not run on a JVM and uses necessary runtime components as thread scheduling or GC from “Substrate VM” – a trivial version of a virtual machine. Since the resulting native binary includes application classes, JDK dependencies and libraries already, the startup and execution time reduces significantly.
GraalVM Native Image is officially supported by the Fn, Gluon, Helidon, Micronaut, Picocli, Quarkus, Vert.x and Spring Boot Java frameworks.  In September 2016, Oracle detailed plans to add ahead-of-time compilation to the OpenJDK using the GraalVM compiler for Java 9. This proposal, tracked by the JEP 295: Ahead-of-Time Compilation, was included in Java 9. The experimental use of GraalVM as a just-in-time compiler was added for the Linux x86-64 platform for Java 10.
In JDK releases 9 to 15, the
jaotc command creates a Native Image. The experimental
-XX:+EnableJVMCIProduct flag enables the use of Graal JIT. The functionality is since available in the native-image component of standalone GraalVM releases.
In association with GraalVM, Oracle Labs developed a language abstract syntax tree interpreter called "Truffle" which would allow it to implement languages on top of the GraalVM. Many languages have been implemented in Truffle, including a C interpreter claiming to be about as fast as GCC and Clang.
The Truffle framework and its dependent part, GraalVM SDK, are released under the Universal Permissive License, version 1.0, to encourage use of the framework for projects which do not want to be bound by the copyright or other parent rights.
A major advantage of the GraalVM ecosystem is language-agnostic, fully dynamic instrumentation support built-in directly into the VM runtime. Execution events can be captured by API clients with overhead that is extremely low in fully optimized code.
GraalVM is written in and for the Java ecosystem. It can execute applications written in all languages that compile to the Java bytecode format, e.g. Java, Scala, Kotlin, and more.
Based on Truffle Language Implementation framework additional languages can be supported in GraalVM.
Support for additional languages can be implemented by users of GraalVM. Some notable third-party language implementations are grCuda, SOMns, TruffleSqueak, and Yona.
GraalVM provides a set of tools for developers, integrators, and IT administrators to debug and monitor GraalVM and deployed applications.
AOT brings about a new tool called 'jaotc' which uses Graal as the backend (to generate code)
Compile an application's Java classes to native code prior to launching the virtual machine.
Compile Java classes to native code prior to launching the virtual machine.
JEP 317: Experimental Java-Based JIT Compiler
Truffle instruments can track very fine-grained VM-level runtime events to profile, inspect, and analyze the runtime behavior of applications running on GraalVM.
Chrome DevTools is a set of web developer tools built directly into the Google Chrome browser. DevTools can help you edit pages on-the-fly and diagnose problems quickly, which ultimately helps you build better websites, faster.