What is native image?
Native Image is a technology to ahead-of-time compile Java code to a standalone executable, called a . This executable includes the application classes, classes from its dependencies, runtime library classes, and statically linked native code from JDK. It does not run on the Java VM, but includes necessary components like memory management, thread scheduling, and so on from a different runtime system, called “Substrate VM”. Substrate VM is the name for the runtime components (like the deoptimizer, garbage collector, thread scheduling etc.). The resulting program has faster startup time and lower runtime memory overhead compared to a JVM. — Oracle
What is GraalVM?
is a Java Development Kit (JDK) written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead of time. This allows for faster initialization, greater runtime performance, and decreased resource consumption, but the resulting executable can only run on the platform it was compiled for.
JIT vs AOT compilations
What is just-in-time compilation?
With just-in-time compilation, portions of the program are dynamically compiled into machine code by the Java Virtual Machine (JVM) while it is executing and analyzing the application's bytecode. JIT compilation enhances performance by optimizing code segments that are often run.
When to use JIT?

Written by
Saad Elattar
Software engineer passionate about building scalable systems, exploring new technologies, and sharing knowledge through writing.
Get in touch