JDK 25 introduces two new JEPs as part of OpenJDK Project Leyden to improve Java startup and warmup performance. JEP 514 simplifies AOT cache creation from a two-step process into a single command using the new -XX:AOTCacheOutput flag, though it still runs two subprocesses internally, which can double peak heap memory usage. JEP 515 extends the AOT cache to store method execution profiles collected during the training run, allowing the JIT compiler to begin generating optimized native code immediately at startup without waiting for the warmup period. Both features work together automatically with no application code changes required, and cached profiles complement rather than replace ongoing runtime profiling.
Table of contents
1. Introduction2. How AOT Cache Worked in JDK 243. One-Shot AOT Cache Creation (JEP 514)4. The Downsides of the One-Shot Approach5. AOT Method Profiling (JEP 515)6. Runtime Profiling vs. Cached Profiling7. ConclusionSort: