mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
8011661: Insufficient memory message says "malloc" when sometimes it should say "mmap"
Reviewed-by: coleenp, zgu, hseigel
This commit is contained in:
parent
a2f5f4ca1b
commit
0f7adcc3d9
31 changed files with 78 additions and 59 deletions
|
@ -77,7 +77,7 @@ void G1BlockOffsetSharedArray::resize(size_t new_word_size) {
|
|||
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
|
||||
|
|
|
@ -1831,7 +1831,7 @@ bool G1CollectedHeap::expand(size_t expand_bytes) {
|
|||
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 @@ G1CollectedHeap::setup_surviving_young_words() {
|
|||
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 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num)
|
|||
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));
|
||||
|
|
|
@ -285,7 +285,7 @@ OtherRegionsTable::OtherRegionsTable(HeapRegion* hr) :
|
|||
_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.");
|
||||
}
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ bool CardTableExtension::resize_commit_uncommit(int changed_region,
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ GCTaskThread::GCTaskThread(GCTaskManager* manager,
|
|||
_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);
|
||||
|
|
|
@ -99,7 +99,7 @@ void ObjectStartArray::set_covered_region(MemRegion mr) {
|
|||
// 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue