comparison src/share/vm/gc_implementation/g1/g1RemSet.cpp @ 4023:c6a6e936dc68

7096030: G1: PrintGCDetails enhancements 7102445: G1: Unnecessary Resource allocations during RSet scanning Summary: Add a new per-worker thread line in the PrintGCDetails output. GC Worker Other is the difference between the elapsed time for the parallel phase of the evacuation pause and the sum of the times of the sub-phases (external root scanning, mark stack scanning, RSet updating, RSet scanning, object copying, and termination) for that worker. During RSet scanning, stack allocate DirtyCardToOopClosure objects; allocating these in a resource area was causing abnormally high GC Worker Other times while the worker thread freed ResourceArea chunks. Reviewed-by: tonyp, jwilhelm, brutisso
author johnc
date Sun, 23 Oct 2011 23:06:06 -0700
parents 811ec3d0833b
children ed80554efa25
comparison
equal deleted inserted replaced
4022:db89aa49298f 4023:c6a6e936dc68
120 } 120 }
121 121
122 void set_try_claimed() { _try_claimed = true; } 122 void set_try_claimed() { _try_claimed = true; }
123 123
124 void scanCard(size_t index, HeapRegion *r) { 124 void scanCard(size_t index, HeapRegion *r) {
125 DirtyCardToOopClosure* cl = 125 // Stack allocate the DirtyCardToOopClosure instance
126 r->new_dcto_closure(_oc, 126 HeapRegionDCTOC cl(_g1h, r, _oc,
127 CardTableModRefBS::Precise, 127 CardTableModRefBS::Precise,
128 HeapRegionDCTOC::IntoCSFilterKind); 128 HeapRegionDCTOC::IntoCSFilterKind);
129 129
130 // Set the "from" region in the closure. 130 // Set the "from" region in the closure.
131 _oc->set_region(r); 131 _oc->set_region(r);
132 HeapWord* card_start = _bot_shared->address_for_index(index); 132 HeapWord* card_start = _bot_shared->address_for_index(index);
133 HeapWord* card_end = card_start + G1BlockOffsetSharedArray::N_words; 133 HeapWord* card_end = card_start + G1BlockOffsetSharedArray::N_words;
138 // We make the card as "claimed" lazily (so races are possible 138 // We make the card as "claimed" lazily (so races are possible
139 // but they're benign), which reduces the number of duplicate 139 // but they're benign), which reduces the number of duplicate
140 // scans (the rsets of the regions in the cset can intersect). 140 // scans (the rsets of the regions in the cset can intersect).
141 _ct_bs->set_card_claimed(index); 141 _ct_bs->set_card_claimed(index);
142 _cards_done++; 142 _cards_done++;
143 cl->do_MemRegion(mr); 143 cl.do_MemRegion(mr);
144 } 144 }
145 } 145 }
146 146
147 void printCard(HeapRegion* card_region, size_t card_index, 147 void printCard(HeapRegion* card_region, size_t card_index,
148 HeapWord* card_start) { 148 HeapWord* card_start) {