Spring Boot

GraalVM Native Images

GraalVM native images for fast startup, native compilation, AOT, reflection hints, limitations

20 pytań z rozmów·
Senior
1

What is GraalVM Native Image?

Odpowiedź

GraalVM Native Image is a technology that compiles Java applications into standalone native executables via AOT (Ahead-of-Time) compilation. Unlike traditional JVM which uses JIT (Just-In-Time) compilation at runtime, Native Image analyzes and compiles all code ahead of time. This enables near-instant startup (milliseconds), reduced memory footprint, and no JVM dependency for execution.

2

What is the main difference between AOT and JIT compilation?

Odpowiedź

AOT (Ahead-of-Time) compilation analyzes and compiles all code before execution, producing an optimized native executable. JIT (Just-In-Time) compilation compiles Java bytecode to machine code progressively during execution. AOT provides instant startup but requires longer build time, while JIT starts slowly but optimizes code over time based on actual usage patterns.

3

Which Maven plugin to use for building a Spring Boot native image?

Odpowiedź

The native-maven-plugin from org.graalvm.buildtools group is the official plugin for building native images with Maven. Spring Boot starter parent activates it automatically in the 'native' profile. Simply declare the plugin in the plugins section and run mvn -Pnative spring-boot:build-image or mvn -Pnative package depending on the desired mode.

4

How to activate the Maven profile for Spring Boot native compilation?

5

What is the 'closed-world assumption' principle in GraalVM Native Image?

+17 pytań z rozmów

Opanuj Spring Boot na następną rozmowę

Uzyskaj dostęp do wszystkich pytań, flashcards, testów technicznych, ćwiczeń code review i symulatorów rozmów.

Zacznij za darmo