diff src/share/vm/gc_implementation/shared/markSweep.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
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/markSweep.cpp	Thu Mar 18 01:48:28 2010 -0700
+++ b/src/share/vm/gc_implementation/shared/markSweep.cpp	Thu Mar 18 13:31:51 2010 -0700
@@ -111,7 +111,8 @@
       assert (obj->is_gc_marked(), "p must be marked");
       obj->follow_contents();
     }
-    while (!_objarray_stack->is_empty()) {
+    // Process ObjArrays one at a time to avoid marking stack bloat.
+    if (!_objarray_stack->is_empty()) {
       ObjArrayTask task = _objarray_stack->pop();
       objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint();
       k->oop_follow_contents(task.obj(), task.index());