Description
Finalization has provided several ways to observe the overall level of finalization activity in the system (e.g. the number of objects yet to be finalized, or pending finalization). These include:
* MemoryMXBean.getObjectPendingFinalizationCount()
* jcmd GC.finalizer_info
* jmap -finalizerinfo
* jdk.FinalizerStatistics JFR event
With the deprecation of finalization, Cleaner becomes the primary mechanism for releasing resources when an object becomes unreachable.
We should provide a similar level of observability for Cleaner.
* MemoryMXBean.getObjectPendingFinalizationCount()
* jcmd GC.finalizer_info
* jmap -finalizerinfo
* jdk.FinalizerStatistics JFR event
With the deprecation of finalization, Cleaner becomes the primary mechanism for releasing resources when an object becomes unreachable.
We should provide a similar level of observability for Cleaner.