Christopher Schnick · XPipe blog · October 23, 2026

Java's new AOT cache feature is in a rough state

Introduction

The AOT (ahead-of-time) cache is the JDK's newest approach to improving startup and warmup times of Java applications. The idea is simple: You perform a training run of your application, during which the JVM records what your application does, e.g. which classes it loads and links and which methods it calls. When your application is later started, the JVM can skip a lot of the initialization work as it is already done and immediately has all the classes available in a loaded and linked state.

In theory, this is a free startup performance boost without having to change anything in your application. In practice, using it for a real-world application that is distributed to users, like we do at XPipe, comes with a lot of pitfalls as we had to learn. In the best case, the AOT cache is just not applied due to incompatibilities and you gain nothing. In the worst case, if you are not careful, your JVM crashes unexpectedly. So essentially a free startup boost, but only under certain conditions, and with free crashes included.