Skip to content

Commit 644072f

Browse files
committed
Refine the AOT Cache creation section
Put Java 25+ snippet first and refine the note. Closes spring-projectsgh-36108
1 parent 859940b commit 644072f

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

framework-docs/modules/ROOT/pages/integration/aot-cache.adoc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,21 @@ JVM flag to start and then exit your Spring application once the
3737
--
3838
[tabs]
3939
======
40-
AOT cache (Java 24)::
40+
41+
AOT cache (Java 25+)::
4142
+
4243
[source,bash,subs="verbatim,quotes"]
4344
----
44-
# Both commands need to be run with the same classpath
45-
java -XX:AOTMode=record -XX:AOTConfiguration=app.aotconf -Dspring.context.exit=onRefresh ...
46-
java -XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot ...
45+
java -XX:AOTCacheOutput=app.aot -Dspring.context.exit=onRefresh -jar application.jar ...
4746
----
4847
49-
AOT cache (Java 25+)::
48+
AOT cache (Java 24)::
5049
+
5150
[source,bash,subs="verbatim,quotes"]
5251
----
53-
java -XX:AOTCacheOutput=app.aot -Dspring.context.exit=onRefresh -jar application.jar ...
52+
# Both commands need to be run with the same classpath
53+
java -XX:AOTMode=record -XX:AOTConfiguration=app.aotconf -Dspring.context.exit=onRefresh ...
54+
java -XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot ...
5455
----
5556
5657
CDS::
@@ -63,9 +64,11 @@ java -XX:ArchiveClassesAtExit=app.jsa -Dspring.context.exit=onRefresh ...
6364
======
6465
--
6566

66-
NOTE: Note, however, that AOT cache among other things stores the method profiling information.
67-
Therefore, it is generally recommended to create an AOT cache for an application that experienced
68-
a portion of a production-like workflow. This way you can ensure that created AOT cache is more accurate.
67+
NOTE: With Java 25+, AOT cache stores, among other things, the
68+
https://openjdk.org/jeps/515[method profiling information]. Therefore, to benefit of this capability,
69+
it is recommended to create an AOT cache for an application that experienced a portion of a
70+
production-like workflow instead of using the `-Dspring.context.exit=onRefresh` flag which designed to
71+
optimize only the startup of your application.
6972

7073
== Using the cache
7174

0 commit comments

Comments
 (0)