Java / GraalVM Interview questions
When should you choose Native Image over running on the JVM?
Native Image makes sense when startup latency and memory footprint dominate your cost or user experience more than raw sustained throughput does.
- Serverless functions - cold-start time directly affects billed duration and perceived latency.
- CLI tools - users expect a command to respond instantly, not warm up.
- Auto-scaling microservices - new instances need to be ready to serve traffic within milliseconds during a scale-out event.
- Resource-constrained containers - lower memory footprint means more instances per node.
Conversely, stick with the regular JVM for long-running services where the JIT has plenty of time to warm up and reach peak throughput, or where you rely heavily on dynamic classloading, agents, or extensive runtime reflection that would require significant native-image configuration work to support.
More Related questions...