Fate of {System|Runtime}.runFinalization (Re: Ad removing finalize eventually

Alan Bateman Alan.Bateman at oracle.com
Wed Aug 4 11:08:12 UTC 2021


On 03/08/2021 17:09, Hans Boehm wrote:
> :
>
> 2) The lack of a clean runFinalization alternative. I think this is 
> actually an opportunity
> to improve things and motivate people to switch away from 
> finalization. But currently
> it pushes in the wrong direction.
>
Maybe but at the same time I don't think runFinalization is widely used. 
A analysis of >100k artifacts from Maven central found only 275 usages 
and this reduces down to about 175 when only the latest version of 
libraries are analyzed. I don't have data to know how many of these have 
been maintained in the last 10 years but at least some of the usages are 
tests or benchmarks. So it might be that there is manageable set of 
examples that can be studied to see if there is big need for something 
to coordinate with reference processing.

-Alan


More information about the jdk-dev mailing list