RFR: JDK-8066859 java/lang/ref/OOMEInReferenceHandler.java failed with java.lang.Exception: Reference Handler thread died
peter.levart at gmail.com
Thu May 7 05:53:38 UTC 2015
This is better (fixed a data race in Cleaner.clean()):
On 05/06/2015 07:13 PM, Peter Levart wrote:
> I might have a closure for this long beard issue  and I'd like to
> propose a change .
> It all started with  discussed here  which resulted in the fix
> for one source of OutOfMemoryError(s) terminating ReferenceHandler
> thread. With this fix, new test was added which started failing
> intermittently indicating there is another source of
> OutOfMemoryError(s) being thrown in ReferenceHandler. At that time,
> the investigation  indicated that the source is "r instanceof
> Cleaner" check and so another change was pushed . The issue
> JDK-8022321 is internal - I don't have a link. That change was 2-fold:
> it added code to preload and pre-initialize Cleaner and
> InterruptedException classes in ReferenceHandler.<clinit> and,
> cowardly, surrounded "r instanceof Cleaner" check with OOME exception
> handler. I'm pretty certain that pre-loading of the classes would have
> been enough. At least it would have not sprung the confusion expressed
> here .
> But even that was not enough to prevent intermittent failures. I
> realized that the test I devised still fails because of
> Cleaner.clean() throwing OOME. Why this is possible is discussed in
> the issue . I even modified the test to reproduce such failure with
> 100% chance.
> So here I propose two things in  :
> - roll-back of the confusing "r instanceof Cleaner" OOME exception
> handling to the shape of code predating change .
> - add handling of OOME in the Cleaner.clean() with updated test that
> checks the behaviour.
> Regards, Peter
>  https://bugs.openjdk.java.net/browse/JDK-8066859
>  https://bugs.openjdk.java.net/browse/JDK-8015434
>  http://hg.openjdk.java.net/jdk9/dev/jdk/rev/d04102f69d46
>  https://bugs.openjdk.java.net/browse/JDK-8055232
More information about the core-libs-dev