On Mon, 11 Jul 2022 04:16:44 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> 8066859 : java/lang/ref/OOMEInReferenceHandler.java failed with 
>> java.lang.Exception: Reference Handler thread died
>
> src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java line 
> 463:
> 
>> 461:      *  Preallocated exceptions thrown if acquiring or releasing locks
>> 462:      *  when OutOfMemory.
>> 463:      */
> 
> I don't see why this should be necessary. IMSE is thrown before any state 
> changes occur and so it is is fine if the IMSE is replaced by OOME.
> 
> Even IE should be safe at the points it is thrown.
> 
> Also in both cases you want to see a full and proper stacktrace.

Consider this another way, any place you have a `throw x` it must be safe to 
propagate that exception. It doesn't matter if that is actually `x` or an OOME 
caused by creating `x`.

-------------

PR: https://git.openjdk.org/jdk/pull/9427

Reply via email to