RFR: JDK-8276422 Add command-line option to disable finalization [v3]
Stuart Marks
smarks at openjdk.java.net
Thu Nov 18 21:22:54 UTC 2021
On Thu, 18 Nov 2021 20:13:23 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> I think this could just be `return InstanceKlass::finalization_enabled();`. There is lots of code in this file and elsewhere that assumes C++ `bool` converts to `jboolean` appropriately.
>
> One typical way for VM to pass the arguments to the library is via private system properties. System::initPhase1 will save the VM properties in `jdk.internal.misc.VM` and filters out the private properties from the system properties returned from System::getProperties (see System::createProperties).
>
> You can query the flag via `jdk.internal.misc.VM.getProperty("jdk.finalization.disabled")` for example.
>
> I don't see any issue moving the Finalizer class initialization after initPhase1 since there is no finalizer during VM startup.
I renamed the function to `is_finalization_enabled` per previous comment, and I also made these cleanups.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6442
More information about the core-libs-dev
mailing list