On Thu, 18 Nov 2021 07:44:05 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:

>> @shipilev not sure what you mean by  "a flag on the Java side". The Java 
>> code just queries the VM for the finalization enabled/disabled state and 
>> uses that to control things.
>
> Yeah, "flag" is `Holder.ENABLED` here. I mean, are Java methods 
> `registerFinalizer` and `runFinalization` called only by VM? If so, can VM 
> check the whole thing on VM side, without going to Java and asking back from 
> there?

I think @shipilev asks a good question. This could be done completely in the VM 
without the changes to j.l.ref.Finalizer. The CLI option is for experimenting, 
at least in the short term, and should be benign to have the Finalizer thread 
running, it just won't do anything.

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

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

Reply via email to