--- old/src/hotspot/share/adlc/arena.cpp 2018-11-15 07:49:17.471631295 -0800 +++ new/src/hotspot/share/adlc/arena.cpp 2018-11-15 07:49:17.051592223 -0800 @@ -24,6 +24,16 @@ #include "adlc.hpp" +void* AllocateHeap(size_t size) { + unsigned char* ptr = (unsigned char*) malloc(size); + if (ptr == NULL && size != 0) { + fprintf(stderr, "Error: Out of memory in ADLC\n"); // logging can cause crash! + fflush(stderr); + exit(1); + } + return ptr; +} + void* Chunk::operator new(size_t requested_size, size_t length) throw() { return CHeapObj::operator new(requested_size + length); } @@ -164,7 +174,7 @@ // CHeapObj void* CHeapObj::operator new(size_t size) throw() { - return (void *) malloc(size); + return (void *) AllocateHeap(size); } void CHeapObj::operator delete(void* p){