Finalizer being run while class still in use (escape analysis bug)
Andrew Haley
aph at redhat.com
Wed Oct 10 12:38:34 UTC 2018
On 10/10/2018 11:56 AM, Luke Hutchison wrote:
> For examle, I just tested this, and it seems to prevent the finalizer from
> being run early (I create a local static instance FENCE of type Fence to
> try to avoid Hotspot optimizing away the empty method
> Fence::reachabilityFence) -- but is there a reason this could fail with
> future Hotspot optimizations?:
Absolutely, yes. I'm surprised it works.
A volatile store will probably work, but even that isn't guaranteed
unless someone reads the result of the store.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-dev
mailing list