You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ahead-of-time cache is a JVM feature introduced in Java 24 via the
6
+
The ahead-of-time cache is a JVM feature introduced in Java 24 via
7
7
https://openjdk.org/jeps/483[JEP 483] that can help reduce the startup time and memory
8
-
footprint of Java applications. AOT cache is a natural evolution of https://docs.oracle.com/en/java/javase/17/vm/class-data-sharing.html[Class Data Sharing (CDS)].
8
+
footprint of Java applications. AOT cache is a natural evolution of
9
+
https://docs.oracle.com/en/java/javase/17/vm/class-data-sharing.html[Class Data Sharing (CDS)].
9
10
Spring Framework supports both CDS and AOT cache, and it is recommended that you use the
10
11
latter if available in the JVM version you are using (Java 24+).
11
12
12
13
To use this feature, an AOT cache should be created for the particular classpath of the
13
14
application. It is possible to create this cache on the deployed instance, or during a
14
-
training run performed for example when packaging the application thanks to an hook-point
15
+
training run performed for example when packaging the application thanks to a hook-point
15
16
provided by the Spring Framework to ease such use case. Once the cache is available, users
16
17
should opt in to use it via a JVM flag.
17
18
18
19
NOTE: If you are using Spring Boot, it is highly recommended to leverage its
19
20
{spring-boot-docs-ref}/packaging/efficient.html#packaging.efficient.unpacking[executable JAR unpacking support]
20
-
which is designed to fulfill the class loading requirements of both AOT cache and CDS.
21
+
which is designed to fulfill the class loading requirements of both the AOT cache and CDS.
21
22
22
23
== Creating the cache
23
24
@@ -29,7 +30,7 @@ invoked; but the lifecycle has not started, and the `ContextRefreshedEvent` has
29
30
been published.
30
31
31
32
To create the cache during the training run, it is possible to specify the `-Dspring.context.exit=onRefresh`
32
-
JVM flag to start then exit your Spring application once the
33
+
JVM flag to start and then exit your Spring application once the
0 commit comments