Finalizer being run while class still in use (escape analysis bug)

Luke Hutchison luke.hutch at gmail.com
Wed Oct 10 13:08:25 UTC 2018


OK, I understand the scope of the problem much better now.

Thank you all for taking the time to patiently explain all of this, despite
the fact that as Andrew pointed out, this has been debated for over a
decade.

I removed the finalizer from my class, and I'm punting responsibility to
the caller to simply call the close() method if they don't want to leak
resources.

I guess I simply didn't want to believe that finalizers were as broken as
they were rumored to be -- and I don't think the full scope of these
problems can be fully grasped until there's an issue like this that has to
be debugged!


More information about the hotspot-dev mailing list