< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp

Print this page
rev 49076 : Traversal: Initialize extra liveness arrays when conc-threads > par-threads

@@ -168,14 +168,10 @@
 
   void work(uint worker_id) {
     ShenandoahObjToScanQueueSet* queues = _heap->traversal_gc()->task_queues();
     ShenandoahObjToScanQueue* q = queues->queue(worker_id);
 
-    // Initialize live data.
-    jushort* ld = _heap->traversal_gc()->get_liveness(worker_id);
-    Copy::fill_to_bytes(ld, _heap->num_regions() * sizeof(jushort));
-
     bool process_refs = _heap->shenandoahPolicy()->process_references();
     bool unload_classes = _heap->shenandoahPolicy()->unload_classes();
     ReferenceProcessor* rp = NULL;
     if (process_refs) {
       rp = _heap->ref_processor();

@@ -354,10 +350,16 @@
     prepare();
   }
 
   _heap->set_concurrent_traversal_in_progress(true);
 
+  // Initialize liveness arrays.
+  for (uint worker_id = 0; worker_id < _heap->max_workers(); worker_id++) {
+    jushort* ld = get_liveness(worker_id);
+    Copy::fill_to_bytes(ld, _heap->num_regions() * sizeof(jushort));
+  }
+
   bool process_refs = _heap->shenandoahPolicy()->process_references();
   if (process_refs) {
     ReferenceProcessor* rp = _heap->ref_processor();
     rp->enable_discovery(true /*verify_no_refs*/);
     rp->setup_policy(false);
< prev index next >