RFR: Prototype AOTMXBean
Vladimir Kozlov
kvn at openjdk.org
Tue May 6 15:18:49 UTC 2025
On Tue, 6 May 2025 07:26:53 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>>> > AOT is a JDK feature rather than standard feature so you might want to think of making it JDK specific, in jdk.management, rather than as a standard MXBean.
>>>
>>> Is there any difference in terms of visibility between java.management vs jdk.management? Aer both modules visible by default in a standard JDK build?
>>
>> Both modules export APIs so both modules will be resolved by default when the initial module is the "class path". Running with -Dcom.sun.management.jmxremote doesn't change that.
>>
>> They will also be resolved when the initial module is a named module, e.g. java -m app, even if app doesn't transitively depends on java.management or jdk.management. This is because of services and specifically java.management provides an implementation of JAAS LoginModule that can be used by java.base, and jdk.management provides additional platform MXBeans that can be used by java.management.
>>
>> So nothing here where the initial module or command line options will cause a concern.
>>
>> In any case, I think this MXBean is best prototyped in the jdk.management module, and in the jdk.management package. VirtualThreadSchedulerMXBean was recently added to this module. In JMX speak, that MXBean defines several attributes and an operation to control the scheduler. The proposal in this MXBean maps to 3 attributes and an operation to stop recording.
>
>> The module names look good. Perhaps we can have a more descriptive name than AOTMXBean? @AlanBateman any suggestions?
>
> Something like "AheadOfTimeCacheMXBean", registered with the MBeanServer as "jdk.management:type=AheadOfTimeCache", might be closer to what you want.
>
> An enum could be used to model the modes and that would give you a place to specify them too. Right now the prototype uses a string "representing the current AOT mode" so you would need to search around to know what the modes are.
>
> The operation to stop the recording is currently named "endRecording" so there is a mix of "stop" and "end", pick one.
>
> The recording duration attribute (getRecordingDuration method) will need to say more. When does recording start, so it this VM uptime?
@AlanBateman We don't use AheadOfTime in our flags or class names. We use well known acronym AOT. I think we should be consistent everywhere.
-------------
PR Comment: https://git.openjdk.org/leyden/pull/52#issuecomment-2854952244
More information about the leyden-dev
mailing list