When examining the assembler output (compiled with -O2) from this class:
public class T
Object o = new Object();
We see a check for a null return value from _Jv_AllocObjectNoFinalizer (i.e. the new operator).
However _Jv_AllocObjectNoFinalizer always returns non-null values. On out-of-memory it throws an OutOfMemoryError
Confirmed, just like the example in PR 19476 for the C++ case.
Will look into marking _Jv_AllocObjectNoFinalizer with the non zero attribute which is added with PR 20318.
This is actually a dup of bug 21856.
*** This bug has been marked as a duplicate of 21856 ***