Oracle has released GraalVM 22.0. The current release of the virtual machine brings a connection to GitHub Actions and continues to work on the reduction of native images, but there are also some innovations for programming languages beyond Java. For example, version 22.0 for JavaScript enables ECMAScript 2022 mode by default and bumps the Node.js runtime to version 14.18.1. The Ruby version has now reached 3.0 and the pyexpat and _csv modules can now be used in Python.
The GraalVM virtual machine is based on the HotSpot Java Virtual Machine (JVM) but adds additional components such as a just-in-time compiler (JIT). It is intended to speed up the execution of applications written in Java and other JVM languages. However, it is not limited to these languages, but can also be used with JavaScript, Ruby or Python, for example, thanks to the Language Implementation Framework Truffle. It should also be possible to combine different languages within one application.
Thinner and space-saving native images
The previous release GraalVM 21.3 already reduced the size of native images. GraalVM offers this as an alternative to executing bytecode in the classic JVM and relies on an AOT compiler (ahead-of-time). The current release 22.0 continues the work that has been started and is intended to further reduce the size of the images by introducing a more compressed encoding for stack frame metadata. According to the publishers, a modified implementation of String.format() in the Enterprise Edition should also contribute to a further reduction in size. This innovation is intended to make localization classes inaccessible for small images like “Hello World”.
In addition, GraalVM 22.0 addresses the memory requirements of native executable files. Native images are executed in GraalVM on the supplied runtime system, which contains all the required components including memory management. The new garbage collection policy for the Serial Garbage Collector (Serial GC), first introduced in the previous version 21.3, is now enabled by default, which is said to reduce the maximum RSS size (resident set size) of native executables by up to 30 percent.
GitHub Action for GraalVM
The GraalVM team has launched an official GitHub Action. GitHub Actions can be used to automate software development workflows such as CI/CD (continuous integration/continuous delivery) and combine different actions into a custom workflow. The new GitHub Action for GraalVM is used to set up the GraalVM Community Edition and supports GraalVM features such as native images and truffle languages. It exports a $GRAALVM_HOME environment variable and defaults $JAVA_HOME to $GRAALVM_HOME, allowing building, testing, and deploying applications. Because the GitHub Action expands the $PATH environment variable, it can call Truffle languages and tools directly.
The announcement of the new GraalVM version shows an example of using the GitHub Action in a workflow:
Steps:
– uses: actions/checkout@v2
– uses: graalvm/setup-graalvm@v1
With:
Version: ‘22.0.0.2’
Java version: ’17’
components: ‘native-image’
github token: ${{ secrets.GITHUB_TOKEN }}
– name: Example step
Run: |
echo “GRAALVM_HOME: $GRAALVM_HOME”
echo “JAVA_HOME: $JAVA_HOME”
Java –version
Native-image –version
Installation instructions and roadmap
GraalVM 22.0 is compatible with JDK 11 and JDK 17 and is available for download as GraalVM Community Edition on GitHub and as Oracle GraalVM Enterprise Edition. GraalVM upgrades for macOS are also available via Homebrew Tap for GraalVM and Visual Studio Code in the form of the GraalVM Extension Pack for Java.
According to the roadmad, the 22.x branch will receive a new feature release in each quarter of 2022, making four in total. The maintenance release is the fourth feature release that will receive bug fixes for the next eighteen months. The current release with Long-Term Support (LTS) is version 21.3, which was released last October; the next planned LTS release is planned for October 2023, version 23.3.
All further information on the current version GraalVM 22.0 can be found in the announcement.