graal Documentation

GraalVM compiles applications into native executables that start instantly, scale fast, and use fewer compute resources πŸš€

21,661 stars Java Java 1 file Β· ~4,250 tokens #aot#compiler#graalvm#java
RAW Doc

File: README.md

[ GraalVM on LinkedIn GraalVM on X GraalVM on Bluesky GraalVM on Medium GraalVM on YouTube

GraalVM compiles applications ahead of time into standalone binaries that start instantly, provide peak performance with no warmup, and use fewer resources.
You can use GraalVM just like any other Java Development Kit in your IDE.

The project website at https://www.graalvm.org/ describes how to get started, how to stay connected, and how to contribute.

Documentation

Please refer to the GraalVM website for documentation.
You can find most of the documentation sources in the docs/ directory in the same hierarchy as displayed on the website.
Additional documentation including developer instructions for individual components can be found in corresponding docs/ sub-directories.
The documentation for the Truffle framework, for example, is in truffle/docs/.
This also applies to languages, tools, and other components maintained in related repositories.
Instructions for building GraalVM from source are in vm/README.md.

Get Support

Repository Structure

This source repository is the main repository for GraalVM and includes the following components:

Directory Description
.github/ Configuration files for GitHub issues, workflows, ….
ci/ Configuration files for internal CI/CD infrastructure.
ci_includes/ Configuration include files for internal CI/CD infrastructure.
compiler/ Graal compiler, a modern, versatile compiler written in Java.
espresso-compiler-stub/ A dummy GraalJVMCICompiler implementation for Espresso.
espresso-shared/ Espresso shared code for runtime class loading.
espresso/ Espresso, a meta-circular Java bytecode interpreter for the GraalVM.
regex/ TRegex, a regular expression engine for other GraalVM languages.
sdk/ GraalVM SDK, long-term supported APIs of GraalVM.
substratevm/ Framework for ahead-of-time (AOT) compilation with Native Image.
sulong/ Sulong, an engine for running LLVM bitcode on GraalVM.
tools/ Tools for Graal Languages implemented with the instrumentation framework.
truffle/ Language implementation framework for creating languages and tools.
visualizer/ Ideal Graph Visualizer (IGV), a tool for analyzing Graal compiler graphs.
vm/ Components for building GraalVM distributions.
wasm/ GraalWasm, an engine for running WebAssembly programs on GraalVM.
web-image/ Web Image, an experimental WebAssembly backend for Native Image.

GraalVM provides additional languages, tools, and other components developed in related repositories. These are:

Name Description
GraalJS Implementation of JavaScript and Node.js.
GraalPy Implementation of the Python language.
graalvm-reachability-metadata Reachability metadata for open-source libraries.
Native Build Tools Build tool plugins for GraalVM Native Image.
setup-graalvm GitHub Action for GraalVM.
SimpleLanguage A simple example language built with the Truffle framework.
SimpleTool A simple example tool built with the Truffle framework.

Examples and Tutorials

Explore practical examples, deep-dive workshops, and language-specific demos for working with GraalVM.

Name Description
GraalVM Demos Example applications highlighting GraalVM key features and best practices.
GraalVM Workshops and Tutorials Workshops and tutorials to help you learn and apply GraalVM tools and capabilities.
Graal Languages - Demos and Guides Demo applications and guides for GraalJS, GraalPy, GraalWasm, and other Graal Languages.

License

GraalVM Community Edition is open source and distributed under version 2 of the GNU General Public License with the β€œClasspath” Exception, which are the same terms as for Java. The licenses of the individual GraalVM components are generally derivative of the license of a particular language (see the table below).

Component(s) License
Espresso, Ideal Graph Visualizer, Web Image GPL 2
GraalVM Compiler, SubstrateVM, Tools, VM GPL 2 with Classpath Exception
GraalVM SDK, GraalWasm, Truffle Framework, TRegex Universal Permissive License
Sulong 3-clause BSD

File: docs/README.md

How to Contribute to GraalVM Documentation

The GraalVM documentation is open source and anyone can contribute to make it perfect and comprehensive.
Before contributing, please read the main contribution guide and, if you use AI assistance, the Coding Assistants policy.

The GraalVM documentation is presented in the form of:

  • reference documentation which includes getting started and user guides, reference manuals, examples, security guidelines
  • Javadoc APIs documentation for application developers, or those who write Java compatibility tests or seek to re-implement the GraalVM platform

Here you will find most of the GraalVM documentation sources, in the same hierarchy as displayed on the GraalVM website.
The Truffle framework documentation can be found in the graal/truffle/docs folder.
GraalVM language implementations are developed and tested in repositories separate from the GraalVM core repository, so their user documentation can be found in:

To update the documentation:

  1. Create a GitHub account or sign in to your existing account
  2. Navigate to the source file you intend to update
  3. Edit the files locally or use GitHub's web editor for small changes.

    Note: GitHub's online editor can be opened by pressing . on the repository page. For example, on https://github.com/oracle/graal, pressing . opens https://github.dev/oracle/graal.

  4. Create a Pull Request (PR) with a clear summary and testing information
  5. Sign the Oracle Contributor Agreement
  6. Watch your PR for review and pipeline results

A member from the GraalVM project team will review your PR and merge as appropriate.
There is a CI pipeline which will pick up your change once merged to the master branch, and publish on the website.

Code of Conduct

The GraalVM core and its projects are hosted in the Oracle organization on GitHub, so we expect contributors to abide by the Contributor Covenant Code of Conduct.
For more specific guidelines see Contribute to GraalVM.

Do not hesitate to push fixes to broken links or typos, update an outdated section, propose information if you find it missing, or propose a new feature documentation.
Help us make GraalVM better by improving the existing and contributing new documentation!


File: docs/introduction.md


Introduction to GraalVM

GraalVM accelerates application performance while consuming fewer resources—improving application efficiency and reducing IT costs.
It achieves this by compiling your Java application ahead of time into a native binary.
The binary is smaller, starts up to 100x faster, provides peak performance with no warmup, and uses less memory and CPU than an application running on a Java Virtual Machine (JVM).
With profile-guided optimization and the G1 (Garbage-First) garbage collector, you can get lower latency and on-par or better peak performance and throughput compared to an application running on a JVM.

Key Benefits

GraalVM's key benefits are:

  • Low Resource Usage: A Java application compiled ahead-of-time by GraalVM requires less memory and CPU to run. No memory and CPU cycles are spent on just-in-time compilation. As a result, your application needs fewer resources to run and is cheaper to operate at scale.
  • Fast Startup: With GraalVM, you can start your Java application faster by initializing parts of it at build time instead of runtime, and instantly achieve predictable peak performance with no warmup.
  • Compact Packaging: A Java application compiled ahead-of-time by GraalVM is small and can be easily packaged into a lightweight container image for fast and efficient deployment.
  • Improved Security: GraalVM reduces the attack surface of your Java application by excluding the following: unreachable code (unused classes, methods, and fields), the just-in-time compilation infrastructure, and build-time initialized code. GraalVM's closed world assumption prevents your application from loading unknown code by disabling dynamic features such as reflection, serialization, and so on at runtime, and requires an explicit include list of such classes, methods, and fields at build time. GraalVM can embed a software bill of materials (SBOM) in your binary, making it easier for you to use common security scanners to check your Java application for published Common Vulnerabilities and Exposures (CVEs).
  • Easily Build Cloud Native Microservices: Popular microservices frameworks such as Micronaut, Spring Boot, Helidon, and Quarkus, and cloud platforms such as Oracle Cloud Infrastructure (OCI), Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure all support GraalVM. This makes it easy for you to build cloud native Java microservices, compiled as binaries, packaged in small containers, and run on the most popular cloud platforms.
  • Extend your Java Application with Python and Other Languages: With GraalVM you can embed languages such as Python, JavaScript, and others to extend your Java application.
  • Use Existing Development and Monitoring Tools: Your existing Java application development and monitoring tools work with GraalVM application binaries. GraalVM provides build plugins for Maven and Gradle, and GitHub Actions for CI/CD. GraalVM supports Java Flight Recorder (JFR), Java Management Extensions (JMX), heap dumps, VisualVM, and other monitoring tools. GraalVM works with existing Java editors/IDEs, and unit test frameworks such as JUnit.

Licensing and Support

Oracle GraalVM is licensed under GraalVM Free Terms and Conditions (GFTC) including License for Early Adopter Versions.
Subject to the conditions in the license, including the License for Early Adopter Versions, the GFTC is intended to permit use by any user including commercial and production use. Redistribution is permitted as long as it is not for a fee.
GraalVM Community Edition is open-source project built from the sources available on GitHub and distributed under version 2 of the GNU General Public License with the β€œClasspath” Exception, which are the same terms as for Java.
Check the licenses of individual GraalVM components which are generally derivative of the license of a particular language and may differ.