We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f925696 commit 289c30bCopy full SHA for 289c30b
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
@@ -1296,7 +1296,10 @@ void ShenandoahHeap::object_iterate(ObjectClosure* cl) {
1296
ShenandoahHeapIterationRootScanner rp;
1297
ObjectIterateScanRootClosure oops(&_aux_bit_map, &oop_stack);
1298
1299
- if (unload_classes()) {
+ // If we are unloading classes right now, we should not touch weak roots,
1300
+ // on the off-chance we would evacuate them and make them live accidentally.
1301
+ // In other cases, we have to scan all roots.
1302
+ if (is_evacuation_in_progress() && unload_classes()) {
1303
rp.strong_roots_do(&oops);
1304
} else {
1305
rp.roots_do(&oops);
0 commit comments