jmx-dev RFR: 8369736 - Add management interface for AOT cache creation [v4]

Mat Carter macarte at openjdk.org
Wed Oct 29 21:07:53 UTC 2025


On Tue, 28 Oct 2025 10:01:14 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated test based on comments
>
> test/hotspot/jtreg/runtime/cds/appcds/aotCache/HotSpotAOTCacheMXBeanTest.java line 98:
> 
>> 96:     public static void main(String[] args) {
>> 97:         System.out.println("Hello Leyden " + args[0]);
>> 98:         var aotBean = ManagementFactory.getPlatformMXBean(HotSpotAOTCacheMXBean.class);
> 
> This uses MF.getPlatformMXBean in the child VM. A more complete test would repeat with:
> 
>         MBeanServer server = ManagementFactory.getPlatformMBeanServer();
>         HotSpotAOTCacheMXBean bean = ManagementFactory.newPlatformMXBeanProxy(server,
>                 "jdk.management:type=HotSpotAOTCacheMXBean",
>                 HotSpotAOTCacheMXBean.class);
> 
> 
> In any case, it might be simpler to test that the MXBean is registered in the test itself, it doesn't need to be in the child VM.

Thanks Alan, I changed the code per your recommendation to not use ManagementFactory.getPlatformMXBean

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2475470100


More information about the jmx-dev mailing list