Faster Java Startup with AOT Cache Profile Improvements

2025-05-11

This improvement significantly reduces Java application warmup time by collecting method execution profiles during application training runs and storing them in the AOT cache. At startup in production, the JIT compiler can immediately use these profiles to generate native code, eliminating the wait for profile collection and resulting in faster startup and peak performance. This technique requires no code changes and is compatible with existing AOT cache creation commands. Experiments show a 19% reduction in warmup time for a simple example program.

Read more
Development AOT cache

Java to Strengthen Immutability of Final Fields

2025-03-31

To enhance the safety and performance of Java programs, the JDK plans to strengthen the immutability of final fields. Currently, deep reflection can modify final fields, which violates the original intention of the final keyword and limits JVM optimization. Future releases will default to prohibiting deep reflection from modifying final fields and will issue warnings. Developers can selectively enable modification of final fields using the `--enable-final-field-mutation` option, but it is recommended to avoid it as much as possible. This move aims to improve Java's "security by default" feature and maintain consistency with the design of record classes.

Read more

Java JEP 483: Ahead-of-Time Class Loading & Linking Boosts Startup Time

2024-12-22

JEP 483 significantly improves Java application startup time by loading and linking application classes ahead of time when the HotSpot JVM starts. It achieves this by monitoring a single application run, storing the loaded and linked forms of all classes in a cache for reuse in subsequent runs. This feature requires no code changes and offers substantial speed improvements for large server applications, such as Spring PetClinic showing a 42% reduction in startup time. While currently a two-step process, future versions will streamline cache creation to a single step and offer more flexible training run configuration.

Read more
Development