I've been experimenting with optimizing a conventional Spring Boot application on HotSpot JDK 27, without switching to GraalVM Native Image.
The setup was a 512 MiB / 1 vCPU Ubuntu VM with no swap, running Spring Boot 4.1.1 and MariaDB on the same machine.
I compared a regular executable JAR with an extracted deployment using Spring AOT and a trained JDK AOT cache (Leyden).
Results:
- Startup: 11.91s → 3.79s (68% reduction)
- Median app RSS: 212 → 187 MiB
- Minimum host MemAvailable: 25.6 → 66 MiB
- Request latency: essentially unchanged
One interesting issue: the JVM initially rejected the trained cache because transferring JARs changed their timestamps. The application still started normally, so I had to verify cache acceptance through JVM logs.
I also tried replacing Spring JDBC with manually integrated MyBatis Core. It didn't produce meaningful memory savings and required additional transaction management.
These are single-run observations at 5 rps, with the optimizations combined rather than isolated.
Full write-up and measurements:
https://pvrlabs.xyz/articles/spring-boot-jdk27-optimizations.html?s=rjp
Has anyone experimented with JDK AOT cache in actual deployments? I'm curious how you manage cache training and validation as part of your build pipeline.