Java Revolution with GraalVM

Java Revolution With GraalVM

Java is one of the most well-known programming languages in the world, and is used in almost all fields. Industrial giants in finance, e-commerce, enterprise tech, and other fields rely on Java for complex tech products and services. It is arguably the most useful language in the tech industry now that its value is apparent in mobile, distributed, and big data applications. 

One of the biggest features of Java has been its JIT compiler, a component that converted bytecode to native machine code Just In Time (JIT) to run the code.

However, as the demands of the tech industry have ramped up, JIT is no longer feasible. To that end, Java has released a brand new tool that works on the Ahead Of Time (AOT) principle. This tool, known as GraalVM, allows developers to write and compile code before execution. It consists of a Java Virtual Machine (JVM), and a Java Development Kit (JDK), as well, with a number of optimizations built in. 

Introduction to GraalVM

So, what exactly is GraalVM? 
Now part of Oracle Labs, GraalVM is a high-performance Java Development Kit (JDK) distribution that was designed and built by Sun Microsystems. It accelerates the execution of applications written in Java and other JVM languages and supports JavaScript, Ruby, Python, as well as a number of popular languages. This feature, known as Polyglot, makes it possible to use multiple languages when programming a single application.  

Like most open-source projects, GraalVM comes with 2 types of distributions:  

GraalVM Enterprise – Based on Oracle JDK 

GraalVM Community – Based on OpenJDK  

Both types support Java 11 and Java 17, as well as Windows, Linux, and MacOS x86 64-bit systems. At the time of writing, it also supports ARM 64-bit system.  

GraalVM provides Polyglot runtimes for Node.js, Python, Ruby, R, JavaScript, WebAssembly as shown in the architecture diagram.  

GraalVM Architecture

GraalVM Architecture

Pic Courtesy:  

Features of GraalVM

  1. High Performance – GraalVM offers a number of performance improvements, including faster bootup of applications, leaner code, and reductions in memory and storage footprints.  
  2. Polyglot Programming – GraalVM allows developers to mix multiple programming languages in a single application without any overhead of foreign language calls.  
  3. AOT Native Image Compilation – GraalVM allows developers to convert Java applications to native, thanks to its advanced Ahead Of Time compiler.   
  4. Advanced toolset – GraalVM also offers a broader toolset, including the Chrome DevTools Protocol, VS Code extensions, and Java extensions, all of which can be used for debugging, profiling, and monitoring. 

What makes GraalVM highly performant?

The GraalVM Compiler works on the AOT (ahead-of-time) principle. It performs compilation during build time, long before execution. It also creates a native binary executable, making executing code easier and faster.   

In JIT (just-in-time), the traditional approach of JRE, compilation and execution happen at the same time.   

GraalVM performs a static analysis of the Java bytecode, and collects all the necessary code in use. It then converts the java bytecode of all the collected code into native binary, which can be executed in the binary format independent of JRE.  

The binary code generated in this way is leaner, and takes less time to boot up since it does not need to warm up with unnecessary classes. 


Who is using GraalVM?

Due to its diverse toolset and manifold advantages, industry leaders like Facebook, Oracle Cloud, Nvidia, Goldman Sachs, and Alibaba Group, are using GraalVM in various products and use cases. 


 Which Java frameworks support GraalVM?

In March 2021, Spring announced the launch of “Spring Native”. Spring Native provides support for compiling Spring applications using GraalVM.  As of the current release of Spring Boot 2.6.7, Spring supports the compilation of Spring Boot Applications to native images using GraalVM too. However, Spring continues to support regular JVM as well. For more details, you can visit 

Apart from Spring, Quarkus, Micronaut, Helidon & Gluon Substrate have also introduced support for GraalVM.  

GraalVM In Action

In this section, we will demonstrate the creation of a Spring Boot Application. The goal of this section is to show how to generate a native binary executable step-by-step, as well as to set benchmarks for startup & memory usage. 


  1. Download GraalVM JDK or Docker images and configure them. In this case, we will be using GraalVM CE 22.1.0 with Java 17 
  2. Create a simple Spring Boot project with REST Controller on the “Spring Initializr” portal, using Lombak, Spring data JPA, Web, H2 database, and Spring Native. Alternatively, you can clone this Github repository – which contains the app to be tested. 

Code in action: 

  1. Go to the project folder & run this command. It takes approximately 2-5 minutes of build time
    ./mvnw -DskipTests=true -Pnative clean package 
  2. This will generate a binary in the “Target” folder with the “artifactid” defined in pom.xml 
  3. Run the executable binary. Ideally, it should start just like a Spring Boot App. 

Startup observation: 

Native Binary: 0.439 seconds startup time & 13.4% of memory on 1GB RAM, 1 CPU Core VM 

Standard JAR: 9.604 seconds startup time & 16.6% of memory on 1GB RAM, 1 CPU Core VM  


From the above observations, it is clear that native binary startup is lightning fast, and shows improvements in memory usage as compared to traditional JAR based applications.

Native binary executables are ideal for containers and cloud deployments since they are small, start extremely fast, and use significantly less CPU and memory. They can even be deployed on “Scratch” container images, otherwise known as empty images.

All in all, GraalVM offers significant improvements over its predecessor, and offers a number of tools optimized for cloud-native applications. GraalVM is an excellent choice for building applications in the hottest industries right now, and as the flaws are ironed out, it is sure to become the JDK of choice for Java developers worldwide.

GraalVM Documentation on configuration:  

Spring Native documentation:  


Related Posts

The Role of NFV in 5G Networks: Opportunities and Benefits for Telecom Providers

With 5G networks on the rise, Network Function Virtualization (NFV) has become an important part of the telecom industry. NFV enables telecom providers to reduce the cost and complexity of their networks by providing a virtualized environment for network functions. This blog will explore the role of NFV in 5G networks, the opportunities and benefits that it offers to telecom providers, and how they can use NFV to improve their networks.


Leveraging AWS for Real-Time Fault Detection in the Manufacturing Industry

With the increasing complexity of the manufacturing industry, it is essential to adopt advanced technologies such as AWS cloud computing and machine learning to detect faults in real-time. This blog will discuss how to leverage AWS for real-time fault detection in the manufacturing industry, and the various benefits of this technology.


Leveraging AWS Local Zone for Deploying 5G Network Functions

As 5G networks become increasingly important for businesses and consumers, organizations are looking for ways to deploy 5G network functions quickly and cost-effectively. AWS Local Zone is one of the most promising solutions for this, providing low-latency access to services and data while reducing costs and improving performance. In this blog, we’ll explore how AWS Local Zone can be leveraged to deploy 5G network functions in an efficient and cost-effective manner.


MWC 23 Top Technology Trends

Mobile World Congress (MWC) is the one of the greatest and most influential connectivity events in the mobile industry where mobile device manufacturers, technology providers, and other industry stakeholders come together to showcase their latest products, services, and innovations. MWC 23 was held in Barcelona from 27 February to 2 March 2023. The event highlighted several emerging technologies and latest trends in the industry market. Read the blog to discover the top technology trends at MWC 23 and how these trends grow over the coming years!


Significance of AI to Underpin the Metaverse

The term “Metaverse” generally refers to a hypothetical future version of the internet that would be much more immersive and interactive, resembling a virtual world. Artificial intelligence (AI) is likely to play a major role in the development of the metaverse. AI could be used to create more realistic virtual environments in the future. Explore the blog to understand how can AI shape the Metaverse technology.


The 5G Uprising: Influence on Business and Telco Industry

The impact of 5G on the telecom industry is likely to be substantial and transformative, leading to new growth opportunities, increased efficiency, and improved customer experiences. Explore the blog to understand how 5G will transform business and the telecom industry.


Leave a comment / Query / Feedback

Your email address will not be published. Required fields are marked *