Skip to content

Commit e3b04bc

Browse files
committedJun 15, 2020
8247560: Shenandoah: heap iteration holds root locks all the time
Reviewed-by: zgu
1 parent bc73f12 commit e3b04bc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -1297,11 +1297,16 @@ void ShenandoahHeap::object_iterate(ObjectClosure* cl) {
12971297

12981298
Stack<oop,mtGC> oop_stack;
12991299

1300-
// First, we process GC roots according to current GC cycle. This populates the work stack with initial objects.
1301-
ShenandoahHeapIterationRootScanner rp;
13021300
ObjectIterateScanRootClosure oops(&_aux_bit_map, &oop_stack);
13031301

1304-
rp.roots_do(&oops);
1302+
{
1303+
// First, we process GC roots according to current GC cycle.
1304+
// This populates the work stack with initial objects.
1305+
// It is important to relinquish the associated locks before diving
1306+
// into heap dumper.
1307+
ShenandoahHeapIterationRootScanner rp;
1308+
rp.roots_do(&oops);
1309+
}
13051310

13061311
// Work through the oop stack to traverse heap.
13071312
while (! oop_stack.is_empty()) {

0 commit comments

Comments
 (0)
Please sign in to comment.