comparison src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp @ 1315:c385bf94cfb8

6935839: excessive marking stack growth during full gcs Summary: process one item at a time from the objarray stack/queue Reviewed-by: apetrusenko, tonyp
author jcoomes
date Thu, 18 Mar 2010 13:31:51 -0700
parents 2a1472c30599
children c18cbe5936b8
comparison
equal deleted inserted replaced
1314:3f0549ed0c98 1315:c385bf94cfb8
215 } 215 }
216 216
217 void ParCompactionManager::follow_marking_stacks() { 217 void ParCompactionManager::follow_marking_stacks() {
218 do { 218 do {
219 // Drain the overflow stack first, to allow stealing from the marking stack. 219 // Drain the overflow stack first, to allow stealing from the marking stack.
220 oop obj;
220 while (!overflow_stack()->is_empty()) { 221 while (!overflow_stack()->is_empty()) {
221 overflow_stack()->pop()->follow_contents(this); 222 overflow_stack()->pop()->follow_contents(this);
222 } 223 }
223 oop obj;
224 while (marking_stack()->pop_local(obj)) { 224 while (marking_stack()->pop_local(obj)) {
225 obj->follow_contents(this); 225 obj->follow_contents(this);
226 } 226 }
227 227
228 // Process ObjArrays one at a time to avoid marking stack bloat.
228 ObjArrayTask task; 229 ObjArrayTask task;
229 while (!_objarray_overflow_stack->is_empty()) { 230 if (!_objarray_overflow_stack->is_empty()) {
230 task = _objarray_overflow_stack->pop(); 231 task = _objarray_overflow_stack->pop();
231 objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint(); 232 objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint();
232 k->oop_follow_contents(this, task.obj(), task.index()); 233 k->oop_follow_contents(this, task.obj(), task.index());
233 } 234 } else if (_objarray_queue.pop_local(task)) {
234 while (_objarray_queue.pop_local(task)) {
235 objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint(); 235 objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint();
236 k->oop_follow_contents(this, task.obj(), task.index()); 236 k->oop_follow_contents(this, task.obj(), task.index());
237 } 237 }
238 } while (!marking_stacks_empty()); 238 } while (!marking_stacks_empty());
239 239