< prev index next >

src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

Print this page

 51     _age_table(false),
 52     _tenuring_threshold(g1h->policy()->tenuring_threshold()),
 53     _scanner(g1h, this),
 54     _worker_id(worker_id),
 55     _last_enqueued_card(SIZE_MAX),
 56     _stack_trim_upper_threshold(GCDrainStackTargetSize * 2 + 1),
 57     _stack_trim_lower_threshold(GCDrainStackTargetSize),
 58     _trim_ticks(),
 59     _surviving_young_words_base(NULL),
 60     _surviving_young_words(NULL),
 61     _surviving_words_length(young_cset_length + 1),
 62     _old_gen_is_full(false),
 63     _num_optional_regions(optional_cset_length),
 64     _numa(g1h->numa()),
 65     _obj_alloc_stat(NULL)
 66 {
 67   // We allocate number of young gen regions in the collection set plus one
 68   // entries, since entry 0 keeps track of surviving bytes for non-young regions.
 69   // We also add a few elements at the beginning and at the end in
 70   // an attempt to eliminate cache contention
 71   size_t array_length = PADDING_ELEM_NUM + _surviving_words_length + PADDING_ELEM_NUM;


 72   _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
 73   _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
 74   memset(_surviving_young_words, 0, _surviving_words_length * sizeof(size_t));
 75 
 76   _plab_allocator = new G1PLABAllocator(_g1h->allocator());
 77 
 78   // The dest for Young is used when the objects are aged enough to
 79   // need to be moved to the next space.
 80   _dest[G1HeapRegionAttr::Young] = G1HeapRegionAttr::Old;
 81   _dest[G1HeapRegionAttr::Old]   = G1HeapRegionAttr::Old;
 82 
 83   _closures = G1EvacuationRootClosures::create_root_closures(this, _g1h);
 84 
 85   _oops_into_optional_regions = new G1OopStarChunkedList[_num_optional_regions];
 86 
 87   initialize_numa_stats();
 88 }
 89 
 90 size_t G1ParScanThreadState::flush(size_t* surviving_young_words) {
 91   _rdcq.flush();
 92   flush_numa_stats();
 93   // Update allocation statistics.

 51     _age_table(false),
 52     _tenuring_threshold(g1h->policy()->tenuring_threshold()),
 53     _scanner(g1h, this),
 54     _worker_id(worker_id),
 55     _last_enqueued_card(SIZE_MAX),
 56     _stack_trim_upper_threshold(GCDrainStackTargetSize * 2 + 1),
 57     _stack_trim_lower_threshold(GCDrainStackTargetSize),
 58     _trim_ticks(),
 59     _surviving_young_words_base(NULL),
 60     _surviving_young_words(NULL),
 61     _surviving_words_length(young_cset_length + 1),
 62     _old_gen_is_full(false),
 63     _num_optional_regions(optional_cset_length),
 64     _numa(g1h->numa()),
 65     _obj_alloc_stat(NULL)
 66 {
 67   // We allocate number of young gen regions in the collection set plus one
 68   // entries, since entry 0 keeps track of surviving bytes for non-young regions.
 69   // We also add a few elements at the beginning and at the end in
 70   // an attempt to eliminate cache contention
 71   const size_t padding_elem_num = (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t));
 72   size_t array_length = padding_elem_num + _surviving_words_length + padding_elem_num;
 73 
 74   _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
 75   _surviving_young_words = _surviving_young_words_base + padding_elem_num;
 76   memset(_surviving_young_words, 0, _surviving_words_length * sizeof(size_t));
 77 
 78   _plab_allocator = new G1PLABAllocator(_g1h->allocator());
 79 
 80   // The dest for Young is used when the objects are aged enough to
 81   // need to be moved to the next space.
 82   _dest[G1HeapRegionAttr::Young] = G1HeapRegionAttr::Old;
 83   _dest[G1HeapRegionAttr::Old]   = G1HeapRegionAttr::Old;
 84 
 85   _closures = G1EvacuationRootClosures::create_root_closures(this, _g1h);
 86 
 87   _oops_into_optional_regions = new G1OopStarChunkedList[_num_optional_regions];
 88 
 89   initialize_numa_stats();
 90 }
 91 
 92 size_t G1ParScanThreadState::flush(size_t* surviving_young_words) {
 93   _rdcq.flush();
 94   flush_numa_stats();
 95   // Update allocation statistics.
< prev index next >