Java / GraalVM Interview questions
What is Native Image in GraalVM?
Native Image is the GraalVM utility that ahead-of-time (AOT) compiles a Java application, together with the JDK classes it actually uses, into a single self-contained native executable.
Instead of starting a JVM, loading classes, and warming up the JIT before reaching peak performance, the resulting binary runs machine code directly from the moment it starts, so startup is typically measured in milliseconds instead of hundreds of milliseconds or seconds.
The trade-off is that everything reachable by the application must be known at build time: reflection, dynamic proxies, and resource loading need explicit configuration, since there is no classloader scanning the classpath at runtime.
It's commonly used for CLI tools, serverless functions, and microservices where fast startup and low memory footprint matter more than the JIT's long-run peak throughput.
More Related questions...