RFR: JDK-8276422 Add command-line option to disable finalization

David Holmes dholmes at openjdk.java.net
Thu Nov 18 07:58:39 UTC 2021


On Thu, 18 Nov 2021 07:16:56 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> There is nothing here to make the various GCs take advantage of finalization being disabled. Is the plan to leave that to followup changes?

@kimbarrett I provided the basic VM parts here. I'm not aware of what specifically a GC might optimise if it knows there can be no finalizers, but that seems like something the GC folk should look to providing as a follow up. Thanks.

> src/hotspot/share/oops/instanceKlass.hpp line 338:
> 
>> 336: 
>> 337:   // Queries finalization state
>> 338:   static bool finalization_enabled() { return _finalization_enabled; }
> 
> Predicate functions like this are often named "is_xxx"; that idiom is common in this class.

This was intended as an accessor function, similar to `count()` or `offset()` not a query as-in `is_shared_boot_class()`. As it is a boolean field you could convert it to a query instead.

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

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



More information about the build-dev mailing list