History of finalizer execution and gc progress?

Stephan Bergmann sbergman at redhat.com
Tue Jun 17 07:15:16 UTC 2014

Hi all,

Does anybody recollect historical details of how execution of 
(potentially long-running) finalizers impacted overall gc progress?

 From the behavior of a small test program run on OpenJDK 8, it looks 
like recent JVMs at least offload all finalizer calls to a single 
dedicated thread, so that a blocking finalizer blocks finalization (and 
thus reclamation) of other garbage objects with explicit finalizers, but 
reclamation of other garbage proceeds unhindered.

But how was the behavior in the past?  Was it so that in older JVMs 
(still in use around 2005) execution of a blocking finalizer could block 
reclamation of /all/ garbage, even of those objects that did not have 
explicit finalizers?

(I'm asking because in LibreOffice we have a dedicated thread to which 
we offload the actual work done by certain objects' finalize methods, 
introduced around 2005 to work around memory starvation in case one of 
those finalizers took too long.  But I can't remember whether that was 
because no garbage at all was reclaimed in such a scenario---and we 
could drop our additional thread again today---, or because it blocked 
finalization of unrelated objects with explicit finalizers---in which 
case we would need to keep our additional thread.)


More information about the hotspot-gc-dev mailing list