December 17, 2020
Oracle GraalVM is a high-performance JDK that can speed up the performance of Java and JVM-based applications using an alternative just-in-time (JIT) compiler. It lowers application latency, improves peak throughput by reducing garbage collection time, and comes with 24/7 Oracle support.
There is also a native image utility that compiles Java bytecode ahead-of-time (AOT) and generates native executables for some applications that start up almost instantaneously and use very little memory resources.
GraalVM started in 2011 as a research project at Oracle Labs to create a runtime platform that can run multiple programming language with high performance. The core of the GraalVM project is the advanced optimizing GraalVM compiler, which is used as a just-in-time (JIT) compiler for the Java Virtual Machine (JVM) or by the GraalVM native image feature to compile Java bytecodes ahead-of-time into native machine code. GraalVM’s Truffle language implementation framework works with the GraalVM compiler to run JavaScript, Python, Ruby, and other supported languages on the JVM with outstanding performance.
When using GraalVM in JIT mode, the JVM uses the GraalVM JIT compiler to create platform-specific machine code from Java bytecode while the application is running. Compilation is performed incrementally during program execution with extra optimization applied to code that is frequently executed. This approach ensures that code in hotspots run extremely fast thanks to aggressive inlining, partial escape analysis, and other advanced optimization. Some optimizations reduce object allocations which lowers the load on the garbage collector. This helps improve the peak performance of long-running applications.
The GraalVM native image utility can also compile Java bytecode to generate native machine executables ahead-of-time (i.e., at build time). These executables start up almost instantly and consume a fraction of the memory that would be used by the same Java application running on the JVM. Native executables are also compact as they only include the classes, methods, and dependent libraries the application requires.
GraalVM also supports multilanguage interoperability through the Truffle language implementation framework. Truffle enables programs written in supported languages to use multilanguage libraries. For example, a JavaScript program can call Ruby methods and share values without making copies. When running on JVM, Truffle collaborates with the GraalVM compiler to compile supported languages to native machine code for optimal performance, just like Java.
Learn more about GraalVM compiler, read the GraalVM for Dummies ebook
GraalVM’s compiler includes a number of additional optimization algorithms that provide significant improvements in performance and resource consumption. GraalVM’s native image features support a number of advanced features, including the G1 garbage collector, compressed pointers, and profile guided optimization which helps the compiler generate more efficient code.
GraalVM is included with Java SE products at no additional cost. It includes 24/7 support by Oracle with access to security fixes and critical path updates for more predictable performance and reliability. For Java migration to the cloud, GraalVM is free to use on Oracle Cloud Infrastructure (OCI).
GraalVM can enable developers to build more efficient code, with better isolation and greater agility for cloud or hybrid environments. Here are some of the reasons why more and more businesses today use GraalVM:
GraalVM innovations help Java code keep up with today’s computing demands with faster performance to respond quickly to customer needs. The advanced optimizer improves peak throughput. It also optimizes memory consumption by minimizing object allocations to reduce time spent performing garbage collection. GraalVM running in JIT mode can boost performance up to 50%. This frees up memory sooner, so you can run other workloads on the same infrastructure and lower IT costs.
Build cloud native applicationsOracle GraalVM’s native image utility compiles bytecode Java applications ahead-of-time into machine binaries. The native executables start up almost 100X faster and consume up to 5X less memory compared to running on a JVM.
As organizations move workloads to the cloud and pay by the hour for the use of system resources, GraalVM can help realize operational cost savings. These results make GraalVM generated native executables ideal for microservices deployment, an area supported by major microservices frameworks, such as Helidon, Micronaut, Quarkus, and Spring Boot.
Develop multilanguage programs and improve productivityYou can run Java and other languages, such as JavaScript, on the JVM with excellent performance. Oracle NetSuite’s SuiteScript is an extension language for end users to customize applications running on NetSuite. Oracle GraalVM enabled NetSuite to embed a Truffle-based JavaScript runtime that can compile JavaScript to machine code that runs 4X faster than SuiteScript running on the JVM.
GraalVM includes an advanced optimizing compiler that generates machine code while the program is running JIT to accelerate Java application performance. By compiling ahead-of-time, the native image starts up fast and uses less memory, making it ideal for cloud native deployment. It supports multilanguage programs to improve productivity by allowing developers to use the best libraries needed to solve business problems irrespective of what language they are written in.