Spec-Zone.ru › OpenJDK 27

Interface HotSpotAOTCacheMXBean

All Superinterfaces:
PlatformManagedObject
public interface HotSpotAOTCacheMXBean extends PlatformManagedObject
Management interface for the JDK's Ahead of Time (AOT) Cache.

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()
If an AOT recording is in progress, ends the recording. This method returns after the AOT artifacts have been completely written.

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 file app.aot. In a future run of the application, the option -XX:AOTCache=app.aot will 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 file app.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:
true if a recording was in progress and has been ended successfully; false otherwise.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 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.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API