AOT class preloading
Cache class loading and compilation for instant startup.
Code Comparison
✕ Java 8
// Every startup: // - Load 10,000+ classes // - Verify bytecode // - JIT compile hot paths // Startup: 2-5 seconds
✓ Java 25
// Training run:
$ java -XX:AOTCacheOutput=app.aot \
-cp app.jar com.App
// Production:
$ java -XX:AOTCache=app.aot \
-cp app.jar com.App
Why the modern way wins
Faster startup
Skip class loading, verification, and linking.
Cached state
Training run captures the ideal class state.
No code changes
Works with existing applications — just add JVM flags.
Old Approach
Cold Start Every Time
Modern Approach
AOT Cache
Since JDK
25
Difficulty
advanced
JDK Support
AOT class preloading
Available
Available in JDK 25 LTS (JEPs 514/515, Sept 2025). Experimental.
How it works
AOT class preloading caches loaded and linked classes from a training run. On subsequent starts, classes are loaded from the cache, skipping verification and linking. Combined with AOT compilation, this dramatically reduces startup time.