Interface HotSpotAOTCacheMXBean
- All Superinterfaces:
PlatformManagedObject
public interface HotSpotAOTCacheMXBean extends PlatformManagedObject
The management interface is registered with the platform MBeanServer. The ObjectName that uniquely identifies the management interface within the MBeanServer is jdk.management:type=HotSpotAOTCache.
Direct access to the MXBean interface can be obtained with ManagementFactory.getPlatformMXBean(Class).
- Since:
- 26
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
endRecording() |
If an AOT recording is in progress, ends the recording. |
Methods declared in interface PlatformManagedObject
getObjectName | Modifier and Type | Method | Description |
|---|---|---|
ObjectName |
getObjectName() |
Returns an ObjectName instance representing the object name of this platform managed object. |
Method Details
endRecording
boolean endRecording()
The JVM will start recording AOT artifacts upon start-up if appropriate JVM options are given in the command-line. The recording will stop when the JVM exits, or when the endRecording method is called. Examples:
$java -XX:AOTCacheOutput=app.aot ....
The JVM records optimization information for the current application in the AOT cache fileapp.aot. In a future run of the application, the option-XX:AOTCache=app.aotwill cause the JVM to use the cache to improve the application's startup and warmup performance.
$java -XX:AOTMode=record -XX:AOTConfiguration=app.aotconfig ....
The JVM records optimization information for the current application in the AOT configuration fileapp.aotconfig. Subsequently, an AOT cache file can be created with the command:$
java -XX:AOTMode=create -XX:AOTConfiguration=app.aotconfig -XX:AOTCache=app.aot ...
For more information about creating and using the AOT artifacts, and detailed specification of the corresponding JVM command-line options, please refer to JEP 483 and JEP 514.
Currently there are no APIs to start an AOT recording. AOT recordings must be started using JVM command-line options such as -XX:AOTCacheOutput. There are also no APIs to query whether an AOT recording is in progress, or what AOT artifacts are being recorded.
This method enables an application to end its own AOT recording programatically, but that is not necessarily the best approach. Doing so requires changing the applicationâs code, which might not be feasible. Even when it is feasible, injecting training-specific logic into the application reduces the similarity between training runs and production runs, potentially making the AOT cache less effective. It may be better to arrange for an external agent to end the training run, thereby creating an AOT cache without interfering with the applicationâs code.
- Returns:
-
trueif a recording was in progress and has been ended successfully;falseotherwise.
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.