comparison src/share/vm/memory/space.cpp @ 3357:fc2b798ab316

6883834: ParNew: assert(!_g->to()->is_in_reserved(obj),"Scanning field twice?") with LargeObjects tests Summary: Fixed process_chunk_boundaries(), used for parallel card scanning when using ParNew/CMS, so as to prevent double-scanning, or worse, non-scanning of imprecisely marked objects exceeding parallel chunk size. Made some sizing parameters for parallel card scanning diagnostic, disabled ParallelGCRetainPLAB, and elaborated and clarified some comments. Reviewed-by: stefank, johnc
author ysr
date Tue, 10 May 2011 00:33:21 -0700
parents abdfc822206f
children 3c648b9ad052
comparison
equal deleted inserted replaced
3325:54a56bbaf95b 3357:fc2b798ab316
95 oop(bottom)->oop_iterate(_cl, mr); 95 oop(bottom)->oop_iterate(_cl, mr);
96 } 96 }
97 } 97 }
98 } 98 }
99 99
100 // We get called with "mr" representing the dirty region
101 // that we want to process. Because of imprecise marking,
102 // we may need to extend the incoming "mr" to the right,
103 // and scan more. However, because we may already have
104 // scanned some of that extended region, we may need to
105 // trim its right-end back some so we do not scan what
106 // we (or another worker thread) may already have scanned
107 // or planning to scan.
100 void DirtyCardToOopClosure::do_MemRegion(MemRegion mr) { 108 void DirtyCardToOopClosure::do_MemRegion(MemRegion mr) {
101 109
102 // Some collectors need to do special things whenever their dirty 110 // Some collectors need to do special things whenever their dirty
103 // cards are processed. For instance, CMS must remember mutator updates 111 // cards are processed. For instance, CMS must remember mutator updates
104 // (i.e. dirty cards) so as to re-scan mutated objects. 112 // (i.e. dirty cards) so as to re-scan mutated objects.
146 154
147 // Top may have been reset, and in fact may be below bottom, 155 // Top may have been reset, and in fact may be below bottom,
148 // e.g. the dirty card region is entirely in a now free object 156 // e.g. the dirty card region is entirely in a now free object
149 // -- something that could happen with a concurrent sweeper. 157 // -- something that could happen with a concurrent sweeper.
150 bottom = MIN2(bottom, top); 158 bottom = MIN2(bottom, top);
151 mr = MemRegion(bottom, top); 159 MemRegion extended_mr = MemRegion(bottom, top);
152 assert(bottom <= top && 160 assert(bottom <= top &&
153 (_precision != CardTableModRefBS::ObjHeadPreciseArray || 161 (_precision != CardTableModRefBS::ObjHeadPreciseArray ||
154 _min_done == NULL || 162 _min_done == NULL ||
155 top <= _min_done), 163 top <= _min_done),
156 "overlap!"); 164 "overlap!");
157 165
158 // Walk the region if it is not empty; otherwise there is nothing to do. 166 // Walk the region if it is not empty; otherwise there is nothing to do.
159 if (!mr.is_empty()) { 167 if (!extended_mr.is_empty()) {
160 walk_mem_region(mr, bottom_obj, top); 168 walk_mem_region(extended_mr, bottom_obj, top);
161 } 169 }
162 170
163 // An idempotent closure might be applied in any order, so we don't 171 // An idempotent closure might be applied in any order, so we don't
164 // record a _min_done for it. 172 // record a _min_done for it.
165 if (!_cl->idempotent()) { 173 if (!_cl->idempotent()) {