RFR: 8266936: Add a finalization JFR event [v12]

Markus Grönlund mgronlun at openjdk.java.net
Sat Sep 25 13:52:56 UTC 2021


On Fri, 24 Sep 2021 22:31:18 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> 
> 
> Hi Markus,
> 
> It's a little surprised to see Finalizer.c to depend JMM interface which is used by `java.management` and `jdk.management` modules only. It's more appropriate for it to be a JVM_* entry point for Finalizer to report completion of the finalization instead. I understand that you want to make FinalizerService to be a conditional feature which is a good idea. Such JVM entry can be made as a nop if not INCLUDE_SERVICES.

Thanks Mandy,
 
I choose jmm.h over jvm.h because I wanted the FinalizerService to be conditional, like some other services/management implementations in the VM. There is conditional compilation support for the 'management' component of the JVM, i.e. INCLUDE_MANAGMENT. The jvm.h function JVM_GetManagement(JMM_VERSION) returns null if this subsystem is not included in the JVM, making it easier to support this as a conditional feature. In addition, I had hoped to see if I could also expose some of this finalizer statistics information via JMX. I did not get around to that, but a few accessors can now easily be added to jmm.h to get to this information and build on it further, should that be useful. There is also the benefit of not having to perform a VM call every time, which is probably only a small upshot because the code will most often be included. 

These reasons do not seem strong enough to motivate a move outside of the original classification, so I am ok to put it into jvm.h instead of jmm.h and create a JVM_Entry with a conditionalized body.

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

PR: https://git.openjdk.java.net/jdk/pull/4731


More information about the core-libs-dev mailing list