Spring Boot Native Images: Your First GraalVM Build, the Startup Numbers, and the Reflection Gotchas
A Spring Boot service starts in seconds and holds a few hundred megabytes of RAM before it serves a single request. A native image starts in milliseconds and holds a fraction of that. The price is the closed-world assumption: the compiler has to see everything your code can do at build time, and Spring Boot is one of the most dynamic frameworks in the Java ecosystem. This post builds a real service both ways and measures the difference. The service is deliberately small — four endpoints, one of them a plain hello — because the interesting part is not the service. It is the three things that break the moment you leave the JVM, and the one mechanism that fixes all three. ...