Chapter 5: Graal Ahead-of-Time Compiler and Native Image
Graal ahead-of-time compilation helps build native images that start up faster, and have a smaller footprint than traditional Java applications. Native images are critical for modern-day cloud-native deployments. GraalVM comes bundled with a tool called native-image
that is used to compile ahead of time and generate native images.
native-image
compiles the code into a native executable/native binary that can run standalone without a virtual machine. The executable includes all the classes, dependencies, libraries, and more importantly, all the virtual machine functionalities such as memory management, thread management, and so on. The virtual machine functionality is packaged as a runtime called Substrate VM. We briefly covered Substrate VM in Chapter 3, GraalVM Architecture, in the Substrate VM (Graal AOT and native image) section. In this chapter, we will gain a deeper understanding of native images. We will learn how to...