< prev index next >
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Print this page
rev 8053 : imported patch alloc
@@ -206,14 +206,10 @@
_cmsSpace = new CompactibleFreeListSpace(_bts, MemRegion(bottom, end),
use_adaptive_freelists,
dictionaryChoice);
NOT_PRODUCT(debug_cms_space = _cmsSpace;)
- if (_cmsSpace == NULL) {
- vm_exit_during_initialization(
- "CompactibleFreeListSpace allocation failure");
- }
_cmsSpace->_gen = this;
_gc_stats = new CMSGCStats();
// Verify the assumption that FreeChunk::_prev and OopDesc::_klass
@@ -228,18 +224,12 @@
)
if (CollectedHeap::use_parallel_gc_threads()) {
typedef CMSParGCThreadState* CMSParGCThreadStatePtr;
_par_gc_thread_states =
NEW_C_HEAP_ARRAY(CMSParGCThreadStatePtr, ParallelGCThreads, mtGC);
- if (_par_gc_thread_states == NULL) {
- vm_exit_during_initialization("Could not allocate par gc structs");
- }
for (uint i = 0; i < ParallelGCThreads; i++) {
_par_gc_thread_states[i] = new CMSParGCThreadState(cmsSpace());
- if (_par_gc_thread_states[i] == NULL) {
- vm_exit_during_initialization("Could not allocate par gc structs");
- }
}
} else {
_par_gc_thread_states = NULL;
}
_incremental_collection_failed = false;
@@ -584,15 +574,10 @@
if (_task_queues == NULL) {
warning("task_queues allocation failure.");
return;
}
_hash_seed = NEW_C_HEAP_ARRAY(int, num_queues, mtGC);
- if (_hash_seed == NULL) {
- warning("_hash_seed array allocation failure");
- return;
- }
-
typedef Padded<OopTaskQueue> PaddedOopTaskQueue;
for (i = 0; i < num_queues; i++) {
PaddedOopTaskQueue *q = new PaddedOopTaskQueue();
if (q == NULL) {
warning("work_queue allocation failure.");
@@ -631,71 +616,29 @@
_end_addr = gch->end_addr();
assert(_young_gen != NULL, "no _young_gen");
_eden_chunk_index = 0;
_eden_chunk_capacity = (_young_gen->max_capacity()+CMSSamplingGrain)/CMSSamplingGrain;
_eden_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, _eden_chunk_capacity, mtGC);
- if (_eden_chunk_array == NULL) {
- _eden_chunk_capacity = 0;
- warning("GC/CMS: _eden_chunk_array allocation failure");
}
- }
- assert(_eden_chunk_array != NULL || _eden_chunk_capacity == 0, "Error");
// Support for parallelizing survivor space rescan
if ((CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) || CMSParallelInitialMarkEnabled) {
const size_t max_plab_samples =
((DefNewGeneration*)_young_gen)->max_survivor_size() / plab_sample_minimum_size();
_survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads, mtGC);
_survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples, mtGC);
_cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads, mtGC);
- if (_survivor_plab_array == NULL || _survivor_chunk_array == NULL
- || _cursor == NULL) {
- warning("Failed to allocate survivor plab/chunk array");
- if (_survivor_plab_array != NULL) {
- FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array);
- _survivor_plab_array = NULL;
- }
- if (_survivor_chunk_array != NULL) {
- FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array);
- _survivor_chunk_array = NULL;
- }
- if (_cursor != NULL) {
- FREE_C_HEAP_ARRAY(size_t, _cursor);
- _cursor = NULL;
- }
- } else {
_survivor_chunk_capacity = 2*max_plab_samples;
for (uint i = 0; i < ParallelGCThreads; i++) {
HeapWord** vec = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples, mtGC);
- if (vec == NULL) {
- warning("Failed to allocate survivor plab array");
- for (int j = i; j > 0; j--) {
- FREE_C_HEAP_ARRAY(HeapWord*, _survivor_plab_array[j-1].array());
- }
- FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array);
- FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array);
- _survivor_plab_array = NULL;
- _survivor_chunk_array = NULL;
- _survivor_chunk_capacity = 0;
- break;
- } else {
- ChunkArray* cur =
- ::new (&_survivor_plab_array[i]) ChunkArray(vec,
- max_plab_samples);
+ ChunkArray* cur = ::new (&_survivor_plab_array[i]) ChunkArray(vec, max_plab_samples);
assert(cur->end() == 0, "Should be 0");
assert(cur->array() == vec, "Should be vec");
assert(cur->capacity() == max_plab_samples, "Error");
}
}
- }
- }
- assert( ( _survivor_plab_array != NULL
- && _survivor_chunk_array != NULL)
- || ( _survivor_chunk_capacity == 0
- && _survivor_chunk_index == 0),
- "Error");
NOT_PRODUCT(_overflow_counter = CMSMarkStackOverflowInterval;)
_gc_counters = new CollectorCounters("CMS", 1);
_completed_initialization = true;
_inter_sweep_timer.start(); // start of time
< prev index next >