RFR: 8156500: deadlock provoked by new stress test com/sun/jdi/OomDebugTest.java

Mandy Chung mandy.chung at oracle.com
Thu Jun 30 02:02:15 UTC 2016


> On Jun 29, 2016, at 6:42 PM, David Holmes <david.holmes at oracle.com> wrote:
> 
> The earlier you initialize Throwable the earlier you can try to create an exception that has a backtrace. But there will always be a region of code where we can't throw an OOME with a backtrace because of the missing initialization of Throwable. So we can narrow that window by moving the initialization of Throwable (which in turn requires a whole bunch of collection classes - so the window has a fixed minimum size [ unless we do some creative restructuring of Throwable's static initialization]). My argument, which I think I've now convinced Kim of, is that we shouldn't be trying to throw an OOME with a stacktrace if Throwable has not been initialized - and that is where the change to gen_out_of_memory_error comes in. It is actually passed the pre-allocated OOME that has no backtrace and will never have a backtrace, and that is what should be thrown when Throwable has not been initialized.

Thanks for the clarification.  It makes sense and the pre-allocated OOME with no backtrace should be used for this early OOM scenario.

Mandy


More information about the core-libs-dev mailing list