On Fri, 19 Nov 2021 00:14:18 GMT, Stuart Marks <smarks@openjdk.org> wrote:
Pretty much what it says. The new option controls a static member in InstanceKlass that's consulted to determine whether the finalization machinery is activated for instances when a class is loaded. A new native method is added so that this state can be queried from Java. This is used to control whether a finalizer thread is created and to disable the `System` and `Runtime::runFinalization` methods. Includes tests for the above.
Adding an option to disable finalization is part of [JEP 421](https://openjdk.java.net/jeps/421).
Stuart Marks has updated the pull request incrementally with one additional commit since the last revision:
Remove Finalizer.Holder class.
Regarding **jcmd** updates, I'm thinking maybe this would be better handled separately. There is the potential to update to `GC.finalizer_info` discussed previously. Looking at the **jcmd** tool docs, it seems like `GC.run_finalization` also ought to be updated. And maybe one or more of the other commands (maybe `VM.flags` or `VM.info`?) ought to list the finalization enabled or disabled status. And of course the tool's doc will need to be updated as well. ------------- PR: https://git.openjdk.java.net/jdk/pull/6442