Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 10161:746b070f5022
8011661: Insufficient memory message says "malloc" when sometimes it should say "mmap"
Reviewed-by: coleenp, zgu, hseigel
author | ccheung |
---|---|
date | Tue, 30 Apr 2013 11:56:52 -0700 |
parents | c0000f77bc6d |
children | d58c62b7447d |
comparison
equal
deleted
inserted
replaced
10160:ed5a590835a4 | 10161:746b070f5022 |
---|---|
1829 // The expansion of the virtual storage space was unsuccessful. | 1829 // The expansion of the virtual storage space was unsuccessful. |
1830 // Let's see if it was because we ran out of swap. | 1830 // Let's see if it was because we ran out of swap. |
1831 if (G1ExitOnExpansionFailure && | 1831 if (G1ExitOnExpansionFailure && |
1832 _g1_storage.uncommitted_size() >= aligned_expand_bytes) { | 1832 _g1_storage.uncommitted_size() >= aligned_expand_bytes) { |
1833 // We had head room... | 1833 // We had head room... |
1834 vm_exit_out_of_memory(aligned_expand_bytes, "G1 heap expansion"); | 1834 vm_exit_out_of_memory(aligned_expand_bytes, OOM_MMAP_ERROR, "G1 heap expansion"); |
1835 } | 1835 } |
1836 } | 1836 } |
1837 return successful; | 1837 return successful; |
1838 } | 1838 } |
1839 | 1839 |
3612 G1CollectedHeap::setup_surviving_young_words() { | 3612 G1CollectedHeap::setup_surviving_young_words() { |
3613 assert(_surviving_young_words == NULL, "pre-condition"); | 3613 assert(_surviving_young_words == NULL, "pre-condition"); |
3614 uint array_length = g1_policy()->young_cset_region_length(); | 3614 uint array_length = g1_policy()->young_cset_region_length(); |
3615 _surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length, mtGC); | 3615 _surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length, mtGC); |
3616 if (_surviving_young_words == NULL) { | 3616 if (_surviving_young_words == NULL) { |
3617 vm_exit_out_of_memory(sizeof(size_t) * array_length, | 3617 vm_exit_out_of_memory(sizeof(size_t) * array_length, OOM_MALLOC_ERROR, |
3618 "Not enough space for young surv words summary."); | 3618 "Not enough space for young surv words summary."); |
3619 } | 3619 } |
3620 memset(_surviving_young_words, 0, (size_t) array_length * sizeof(size_t)); | 3620 memset(_surviving_young_words, 0, (size_t) array_length * sizeof(size_t)); |
3621 #ifdef ASSERT | 3621 #ifdef ASSERT |
3622 for (uint i = 0; i < array_length; ++i) { | 3622 for (uint i = 0; i < array_length; ++i) { |
4395 uint array_length = PADDING_ELEM_NUM + | 4395 uint array_length = PADDING_ELEM_NUM + |
4396 real_length + | 4396 real_length + |
4397 PADDING_ELEM_NUM; | 4397 PADDING_ELEM_NUM; |
4398 _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC); | 4398 _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC); |
4399 if (_surviving_young_words_base == NULL) | 4399 if (_surviving_young_words_base == NULL) |
4400 vm_exit_out_of_memory(array_length * sizeof(size_t), | 4400 vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR, |
4401 "Not enough space for young surv histo."); | 4401 "Not enough space for young surv histo."); |
4402 _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; | 4402 _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; |
4403 memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t)); | 4403 memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t)); |
4404 | 4404 |
4405 _alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer; | 4405 _alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer; |