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

Thomas Schatzl thomas.schatzl at oracle.com
Tue Apr 30 14:57:20 UTC 2013


Hi all,

the webrev at http://cr.openjdk.java.net/~tschatzl/7038914/webrev/ presents a first stab at the CR "7038914: VM could throw uncaught OOME in ReferenceHandler thread".

The problem is that under very heavy memory pressure, there is the reference handler throws an exception with the message "Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Reference Handler".

The change improves handling of out-of-memory conditions in the ReferenceHandler thread. Instead of crashing the thread, and then disabling reference processing, it catches this exception and continues.

I'd like to discuss the change as I'm not really familiar with JDK coding style, handling of such situations and have some questions about it.

Bugs.sun http://bugs.sun.com/view_bug.do?bug_id=7038914

JBS: https://jbs.oracle.com/bugs/browse/JDK-7038914

Proposed webrev: http://cr.openjdk.java.net/~tschatzl/7038914/webrev/

to provide some diagnosability in the case of an exception (when running with assertions). I copied that from other code that tries to catch similar problems in the clean() method of the Cleaners. There are other variants of managing this in the jdk, some involving calling system.exit(). I thought that was too drastic, so I didn't do that, but what is the appropriate way to handle this situation?

Since this is (seems to be) a JDK only change, and this is my first time changing the JDK, I hope core-libs-dev is the right mailing list. Otherwise please direct me to the the appropriate one.

Thanks, Thomas



More information about the core-libs-dev mailing list