# HG changeset patch # User vladidan # Date 1367417457 14400 # Node ID 1847df492437633cb94bea32363d5da1423a11a6 # Parent b4081e9714ec297ffdd8de555dd0a179b36b60f1# Parent 376ff861f6119b95d66d300d547fa9b80ff25965 Merge diff -r b4081e9714ec -r 1847df492437 agent/src/os/bsd/MacosxDebuggerLocal.m --- a/agent/src/os/bsd/MacosxDebuggerLocal.m Tue Apr 30 17:36:01 2013 -0400 +++ b/agent/src/os/bsd/MacosxDebuggerLocal.m Wed May 01 10:10:57 2013 -0400 @@ -707,8 +707,8 @@ task_t gTask = 0; result = task_for_pid(mach_task_self(), jpid, &gTask); if (result != KERN_SUCCESS) { - print_error("attach: task_for_pid(%d) failed (%d)\n", (int)jpid, result); - THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process"); + print_error("attach: task_for_pid(%d) failed: '%s' (%d)\n", (int)jpid, mach_error_string(result), result); + THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process. Could be caused by an incorrect pid or lack of privileges."); } putTask(env, this_obj, gTask); diff -r b4081e9714ec -r 1847df492437 src/os/solaris/vm/os_solaris.cpp --- a/src/os/solaris/vm/os_solaris.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/os/solaris/vm/os_solaris.cpp Wed May 01 10:10:57 2013 -0400 @@ -824,7 +824,7 @@ // allocate new buffer and initialize info = (Dl_serinfo*)malloc(_info.dls_size); if (info == NULL) { - vm_exit_out_of_memory(_info.dls_size, + vm_exit_out_of_memory(_info.dls_size, OOM_MALLOC_ERROR, "init_system_properties_values info"); } info->dls_size = _info.dls_size; @@ -866,7 +866,7 @@ common_path = malloc(bufsize); if (common_path == NULL) { free(info); - vm_exit_out_of_memory(bufsize, + vm_exit_out_of_memory(bufsize, OOM_MALLOC_ERROR, "init_system_properties_values common_path"); } sprintf(common_path, COMMON_DIR "/lib/%s", cpu_arch); @@ -879,7 +879,7 @@ if (library_path == NULL) { free(info); free(common_path); - vm_exit_out_of_memory(bufsize, + vm_exit_out_of_memory(bufsize, OOM_MALLOC_ERROR, "init_system_properties_values library_path"); } library_path[0] = '\0'; @@ -1623,7 +1623,8 @@ // %%% this is used only in threadLocalStorage.cpp if (thr_setspecific((thread_key_t)index, value)) { if (errno == ENOMEM) { - vm_exit_out_of_memory(SMALLINT, "thr_setspecific: out of swap space"); + vm_exit_out_of_memory(SMALLINT, OOM_MALLOC_ERROR, + "thr_setspecific: out of swap space"); } else { fatal(err_msg("os::thread_local_storage_at_put: thr_setspecific failed " "(%s)", strerror(errno))); diff -r b4081e9714ec -r 1847df492437 src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp --- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Wed May 01 10:10:57 2013 -0400 @@ -178,7 +178,7 @@ // JVM needs to know exact stack location, abort if it fails if (rslt != 0) { if (rslt == ENOMEM) { - vm_exit_out_of_memory(0, "pthread_getattr_np"); + vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np"); } else { fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt)); } diff -r b4081e9714ec -r 1847df492437 src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed May 01 10:10:57 2013 -0400 @@ -710,7 +710,7 @@ // JVM needs to know exact stack location, abort if it fails if (rslt != 0) { if (rslt == ENOMEM) { - vm_exit_out_of_memory(0, "pthread_getattr_np"); + vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np"); } else { fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt)); } diff -r b4081e9714ec -r 1847df492437 src/os_cpu/linux_zero/vm/os_linux_zero.cpp --- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Wed May 01 10:10:57 2013 -0400 @@ -313,7 +313,7 @@ int res = pthread_getattr_np(pthread_self(), &attr); if (res != 0) { if (res == ENOMEM) { - vm_exit_out_of_memory(0, "pthread_getattr_np"); + vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np"); } else { fatal(err_msg("pthread_getattr_np failed with errno = %d", res)); diff -r b4081e9714ec -r 1847df492437 src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp --- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Wed May 01 10:10:57 2013 -0400 @@ -591,7 +591,7 @@ // on the thread stack, which could get a mapping error when touched. address addr = (address) info->si_addr; if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) { - vm_exit_out_of_memory(0, "Out of swap space to map in thread stack."); + vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack."); } VMError err(t, sig, pc, info, ucVoid); diff -r b4081e9714ec -r 1847df492437 src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp --- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Wed May 01 10:10:57 2013 -0400 @@ -745,7 +745,7 @@ // on the thread stack, which could get a mapping error when touched. address addr = (address) info->si_addr; if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) { - vm_exit_out_of_memory(0, "Out of swap space to map in thread stack."); + vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack."); } VMError err(t, sig, pc, info, ucVoid); diff -r b4081e9714ec -r 1847df492437 src/share/vm/asm/assembler.cpp --- a/src/share/vm/asm/assembler.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/asm/assembler.cpp Wed May 01 10:10:57 2013 -0400 @@ -44,7 +44,7 @@ CodeSection* cs = code->insts(); cs->clear_mark(); // new assembler kills old mark if (cs->start() == NULL) { - vm_exit_out_of_memory(0, err_msg("CodeCache: no room for %s", + vm_exit_out_of_memory(0, OOM_MMAP_ERROR, err_msg("CodeCache: no room for %s", code->name())); } _code_section = cs; diff -r b4081e9714ec -r 1847df492437 src/share/vm/code/stubs.cpp --- a/src/share/vm/code/stubs.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/code/stubs.cpp Wed May 01 10:10:57 2013 -0400 @@ -67,7 +67,7 @@ intptr_t size = round_to(buffer_size, 2*BytesPerWord); BufferBlob* blob = BufferBlob::create(name, size); if( blob == NULL) { - vm_exit_out_of_memory(size, err_msg("CodeCache: no room for %s", name)); + vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, err_msg("CodeCache: no room for %s", name)); } _stub_interface = stub_interface; _buffer_size = blob->content_size(); diff -r b4081e9714ec -r 1847df492437 src/share/vm/code/vtableStubs.cpp --- a/src/share/vm/code/vtableStubs.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/code/vtableStubs.cpp Wed May 01 10:10:57 2013 -0400 @@ -60,7 +60,7 @@ const int bytes = chunk_factor * real_size + pd_code_alignment(); BufferBlob* blob = BufferBlob::create("vtable chunks", bytes); if (blob == NULL) { - vm_exit_out_of_memory(bytes, "CodeCache: no room for vtable chunks"); + vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "CodeCache: no room for vtable chunks"); } _chunk = blob->content_begin(); _chunk_end = _chunk + bytes; diff -r b4081e9714ec -r 1847df492437 src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Wed May 01 10:10:57 2013 -0400 @@ -77,7 +77,7 @@ assert(delta > 0, "just checking"); if (!_vs.expand_by(delta)) { // Do better than this for Merlin - vm_exit_out_of_memory(delta, "offset table expansion"); + vm_exit_out_of_memory(delta, OOM_MMAP_ERROR, "offset table expansion"); } assert(_vs.high() == high + delta, "invalid expansion"); // Initialization of the contents is left to the diff -r b4081e9714ec -r 1847df492437 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed May 01 10:10:57 2013 -0400 @@ -1831,7 +1831,7 @@ if (G1ExitOnExpansionFailure && _g1_storage.uncommitted_size() >= aligned_expand_bytes) { // We had head room... - vm_exit_out_of_memory(aligned_expand_bytes, "G1 heap expansion"); + vm_exit_out_of_memory(aligned_expand_bytes, OOM_MMAP_ERROR, "G1 heap expansion"); } } return successful; @@ -3614,7 +3614,7 @@ uint array_length = g1_policy()->young_cset_region_length(); _surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length, mtGC); if (_surviving_young_words == NULL) { - vm_exit_out_of_memory(sizeof(size_t) * array_length, + vm_exit_out_of_memory(sizeof(size_t) * array_length, OOM_MALLOC_ERROR, "Not enough space for young surv words summary."); } memset(_surviving_young_words, 0, (size_t) array_length * sizeof(size_t)); @@ -4397,7 +4397,7 @@ PADDING_ELEM_NUM; _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC); if (_surviving_young_words_base == NULL) - vm_exit_out_of_memory(array_length * sizeof(size_t), + vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR, "Not enough space for young surv histo."); _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t)); diff -r b4081e9714ec -r 1847df492437 src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp --- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Wed May 01 10:10:57 2013 -0400 @@ -285,7 +285,7 @@ _fine_grain_regions = new PerRegionTablePtr[_max_fine_entries]; if (_fine_grain_regions == NULL) { - vm_exit_out_of_memory(sizeof(void*)*_max_fine_entries, + vm_exit_out_of_memory(sizeof(void*)*_max_fine_entries, OOM_MALLOC_ERROR, "Failed to allocate _fine_grain_entries."); } diff -r b4081e9714ec -r 1847df492437 src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp Wed May 01 10:10:57 2013 -0400 @@ -567,7 +567,7 @@ MemRegion(new_start_aligned, new_end_for_commit); if (!os::commit_memory((char*)new_committed.start(), new_committed.byte_size())) { - vm_exit_out_of_memory(new_committed.byte_size(), + vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR, "card table expansion"); } } diff -r b4081e9714ec -r 1847df492437 src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Wed May 01 10:10:57 2013 -0400 @@ -43,7 +43,7 @@ _time_stamp_index(0) { if (!os::create_thread(this, os::pgc_thread)) - vm_exit_out_of_memory(0, "Cannot create GC thread. Out of system resources."); + vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create GC thread. Out of system resources."); if (PrintGCTaskTimeStamps) { _time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); diff -r b4081e9714ec -r 1847df492437 src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp --- a/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp Wed May 01 10:10:57 2013 -0400 @@ -99,7 +99,7 @@ // Expand size_t expand_by = requested_blocks_size_in_bytes - current_blocks_size_in_bytes; if (!_virtual_space.expand_by(expand_by)) { - vm_exit_out_of_memory(expand_by, "object start array expansion"); + vm_exit_out_of_memory(expand_by, OOM_MMAP_ERROR, "object start array expansion"); } // Clear *only* the newly allocated region memset(_blocks_region.end(), clean_block, expand_by); diff -r b4081e9714ec -r 1847df492437 src/share/vm/interpreter/interpreterRuntime.cpp --- a/src/share/vm/interpreter/interpreterRuntime.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/interpreter/interpreterRuntime.cpp Wed May 01 10:10:57 2013 -0400 @@ -1052,7 +1052,7 @@ return; } if (set_handler_blob() == NULL) { - vm_exit_out_of_memory(blob_size, "native signature handlers"); + vm_exit_out_of_memory(blob_size, OOM_MALLOC_ERROR, "native signature handlers"); } BufferBlob* bb = BufferBlob::create("Signature Handler Temp Buffer", diff -r b4081e9714ec -r 1847df492437 src/share/vm/memory/allocation.cpp --- a/src/share/vm/memory/allocation.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/memory/allocation.cpp Wed May 01 10:10:57 2013 -0400 @@ -259,7 +259,7 @@ } if (p == NULL) p = os::malloc(bytes, mtChunk, CURRENT_PC); if (p == NULL) - vm_exit_out_of_memory(bytes, "ChunkPool::allocate"); + vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "ChunkPool::allocate"); return p; } @@ -371,7 +371,7 @@ default: { void *p = os::malloc(bytes, mtChunk, CALLER_PC); if (p == NULL) - vm_exit_out_of_memory(bytes, "Chunk::new"); + vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "Chunk::new"); return p; } } @@ -531,7 +531,7 @@ } void Arena::signal_out_of_memory(size_t sz, const char* whence) const { - vm_exit_out_of_memory(sz, whence); + vm_exit_out_of_memory(sz, OOM_MALLOC_ERROR, whence); } // Grow a new Chunk diff -r b4081e9714ec -r 1847df492437 src/share/vm/memory/allocation.inline.hpp --- a/src/share/vm/memory/allocation.inline.hpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/memory/allocation.inline.hpp Wed May 01 10:10:57 2013 -0400 @@ -58,7 +58,9 @@ #ifdef ASSERT if (PrintMallocFree) trace_heap_malloc(size, "AllocateHeap", p); #endif - if (p == NULL && alloc_failmode == AllocFailStrategy::EXIT_OOM) vm_exit_out_of_memory(size, "AllocateHeap"); + if (p == NULL && alloc_failmode == AllocFailStrategy::EXIT_OOM) { + vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "AllocateHeap"); + } return p; } @@ -68,7 +70,9 @@ #ifdef ASSERT if (PrintMallocFree) trace_heap_malloc(size, "ReallocateHeap", p); #endif - if (p == NULL && alloc_failmode == AllocFailStrategy::EXIT_OOM) vm_exit_out_of_memory(size, "ReallocateHeap"); + if (p == NULL && alloc_failmode == AllocFailStrategy::EXIT_OOM) { + vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "ReallocateHeap"); + } return p; } @@ -130,12 +134,12 @@ _addr = os::reserve_memory(_size, NULL, alignment); if (_addr == NULL) { - vm_exit_out_of_memory(_size, "Allocator (reserve)"); + vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (reserve)"); } bool success = os::commit_memory(_addr, _size, false /* executable */); if (!success) { - vm_exit_out_of_memory(_size, "Allocator (commit)"); + vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (commit)"); } return (E*)_addr; diff -r b4081e9714ec -r 1847df492437 src/share/vm/memory/blockOffsetTable.cpp --- a/src/share/vm/memory/blockOffsetTable.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/memory/blockOffsetTable.cpp Wed May 01 10:10:57 2013 -0400 @@ -80,7 +80,7 @@ assert(delta > 0, "just checking"); if (!_vs.expand_by(delta)) { // Do better than this for Merlin - vm_exit_out_of_memory(delta, "offset table expansion"); + vm_exit_out_of_memory(delta, OOM_MMAP_ERROR, "offset table expansion"); } assert(_vs.high() == high + delta, "invalid expansion"); } else { diff -r b4081e9714ec -r 1847df492437 src/share/vm/memory/cardTableModRefBS.cpp --- a/src/share/vm/memory/cardTableModRefBS.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/memory/cardTableModRefBS.cpp Wed May 01 10:10:57 2013 -0400 @@ -116,7 +116,7 @@ _guard_region = MemRegion((HeapWord*)guard_page, _page_size); if (!os::commit_memory((char*)guard_page, _page_size, _page_size)) { // Do better than this for Merlin - vm_exit_out_of_memory(_page_size, "card table last card"); + vm_exit_out_of_memory(_page_size, OOM_MMAP_ERROR, "card table last card"); } *guard_card = last_card; @@ -292,7 +292,7 @@ if (!os::commit_memory((char*)new_committed.start(), new_committed.byte_size(), _page_size)) { // Do better than this for Merlin - vm_exit_out_of_memory(new_committed.byte_size(), + vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR, "card table expansion"); } // Use new_end_aligned (as opposed to new_end_for_commit) because diff -r b4081e9714ec -r 1847df492437 src/share/vm/oops/oop.cpp --- a/src/share/vm/oops/oop.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/oops/oop.cpp Wed May 01 10:10:57 2013 -0400 @@ -111,7 +111,7 @@ // Use alternate hashing algorithm on the string return AltHashing::murmur3_32(seed, chars, length); } else { - vm_exit_out_of_memory(length, "unable to create Unicode strings for String table rehash"); + vm_exit_out_of_memory(length, OOM_MALLOC_ERROR, "unable to create Unicode strings for String table rehash"); return 0; } } diff -r b4081e9714ec -r 1847df492437 src/share/vm/prims/jvmtiTagMap.cpp --- a/src/share/vm/prims/jvmtiTagMap.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/prims/jvmtiTagMap.cpp Wed May 01 10:10:57 2013 -0400 @@ -153,7 +153,8 @@ size_t s = initial_size * sizeof(JvmtiTagHashmapEntry*); _table = (JvmtiTagHashmapEntry**)os::malloc(s, mtInternal); if (_table == NULL) { - vm_exit_out_of_memory(s, "unable to allocate initial hashtable for jvmti object tags"); + vm_exit_out_of_memory(s, OOM_MALLOC_ERROR, + "unable to allocate initial hashtable for jvmti object tags"); } for (int i=0; iprint("# Native memory allocation (malloc) failed to allocate "); + st->print("# Native memory allocation "); + st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " : + "(mmap) failed to map "); jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); st->print(buf); st->print(" bytes"); @@ -386,7 +389,7 @@ return; // that's enough for the screen } break; - case internal_error: + case INTERNAL_ERROR: default: break; } diff -r b4081e9714ec -r 1847df492437 src/share/vm/utilities/vmError.hpp --- a/src/share/vm/utilities/vmError.hpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/utilities/vmError.hpp Wed May 01 10:10:57 2013 -0400 @@ -34,10 +34,6 @@ friend class VM_ReportJavaOutOfMemory; friend class Decoder; - enum ErrorType { - internal_error = 0xe0000000, - oom_error = 0xe0000001 - }; int _id; // Solaris/Linux signals: 0 - SIGRTMAX // Windows exceptions: 0xCxxxxxxx system errors // 0x8xxxxxxx system warnings @@ -96,9 +92,12 @@ // accessor const char* message() const { return _message; } const char* detail_msg() const { return _detail_msg; } - bool should_report_bug(unsigned int id) { return id != oom_error; } + bool should_report_bug(unsigned int id) { + return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR); + } public: + // Constructor for crashes VMError(Thread* thread, unsigned int sig, address pc, void* siginfo, void* context); @@ -108,7 +107,7 @@ // Constructor for VM OOM errors VMError(Thread* thread, const char* filename, int lineno, size_t size, - const char* message); + VMErrorType vm_err_type, const char* message); // Constructor for non-fatal errors VMError(const char* message); diff -r b4081e9714ec -r 1847df492437 src/share/vm/utilities/workgroup.cpp --- a/src/share/vm/utilities/workgroup.cpp Tue Apr 30 17:36:01 2013 -0400 +++ b/src/share/vm/utilities/workgroup.cpp Wed May 01 10:10:57 2013 -0400 @@ -79,7 +79,7 @@ } _gang_workers = NEW_C_HEAP_ARRAY(GangWorker*, total_workers(), mtInternal); if (gang_workers() == NULL) { - vm_exit_out_of_memory(0, "Cannot create GangWorker array."); + vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create GangWorker array."); return false; } os::ThreadType worker_type; @@ -93,7 +93,8 @@ assert(new_worker != NULL, "Failed to allocate GangWorker"); _gang_workers[worker] = new_worker; if (new_worker == NULL || !os::create_thread(new_worker, worker_type)) { - vm_exit_out_of_memory(0, "Cannot create worker GC thread. Out of system resources."); + vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, + "Cannot create worker GC thread. Out of system resources."); return false; } if (!DisableStartThread) {