(Preliminary) RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

Thomas Schatzl thomas.schatzl at oracle.com
Fri May 3 17:47:56 UTC 2013

> Hi Tomas,
> I don't know if this is the case here, but what if the
> ReferenceHandler thread is interrupted while wait()-ing and the
> construction of InterruptedException triggers OOME?

I am sure this is the case - previously I thought InterruptedException
is a preallocated exception like others.
ObjectMonitor::wait() may throw it, by creating new InterruptedException


Now that we've found the very likely cause, what to do about it?

The current state of silently crashing the reference handler thread is
unsatisfying imo as it leads to very hard to find problems.

The options I see all involve catching this (or any other OOME caused by
other means like the test program) and either recovering as much as
possible or exiting the VM (like in the sun.misc.Cleaner handling).

Any other suggestions?


More information about the hotspot-gc-dev mailing list