RFR: 8369736 - Add management interface for AOT cache creation [v8]
Alan Bateman
alanb at openjdk.org
Fri Nov 21 12:04:29 UTC 2025
On Thu, 13 Nov 2025 19:55:24 GMT, Mat Carter <macarte at openjdk.org> wrote:
>> Add jdk.management.AOTCacheMXBean. The interface provides a single action that when called will cause any hosted JVM currently recording AOT information will stop recording. Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode. Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>>
>> The interface will return TRUE if a recording was successfully stopped, in all other cases (not recording etc.) will return FALSE
>>
>> It follows that invoking the action on a JVM that is recording, twice in succession, should (baring internal errors) produce the following two responses:
>>
>> TRUE
>> FALSE
>>
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove single whitespace
test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 31:
> 29: * @requires vm.cds.write.archived.java.heap
> 30: * @library /test/jdk/lib/testlibrary /test/lib
> 31: * /test/hotspot/jtreg/runtime/cds/appcds/aotCache/test-classes
Is test-classes used?
test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 45:
> 43: import jdk.test.lib.process.OutputAnalyzer;
> 44:
> 45: public class HotSpotAOTCacheMXBeanTest {
In addition to testing the endRecording operation, we also need to test both the direct and indirect access to the MXBean. The test currently obtains a proxy with newPlatformMXBeanProxy (good) but the direct access with ManagementFactory.getPlatformMXBean is not tested right now.
Another thing to test is that getObjectName returns the expected object name.
test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 92:
> 90: }
> 91: out.shouldNotContain("HotSpotAOTCacheMXBean is not available");
> 92: out.shouldNotContain("IOException occurred!");
Have you considering have the child terminate with an exception so the exit status is non-0. If you get a success status then the output should have the expected strings. A non-0 would failure, and the test fails.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549496991
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549513596
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2549518555
More information about the hotspot-dev
mailing list