hotspot/src/share/vm/gc/cms/parNewGeneration.cpp
changeset 38198 8144ec8f789e
parent 38033 996ce936543f
child 40096 246c62cd9180
--- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp	Tue May 03 07:23:23 2016 -0700
+++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp	Thu May 05 08:51:27 2016 -0700
@@ -476,7 +476,6 @@
 
     // Inform old gen that we're done.
     _old_gen.par_promote_alloc_done(i);
-    _old_gen.par_oop_since_save_marks_iterate_done(i);
   }
 
   if (UseConcMarkSweepGC) {
@@ -619,6 +618,16 @@
 
   // "evacuate followers".
   par_scan_state.evacuate_followers_closure().do_void();
+
+  // This will collapse this worker's promoted object list that's
+  // created during the main ParNew parallel phase of ParNew. This has
+  // to be called after all workers have finished promoting objects
+  // and scanning promoted objects. It should be safe calling it from
+  // here, given that we can only reach here after all thread have
+  // offered termination, i.e., after there is no more work to be
+  // done. It will also disable promotion tracking for the rest of
+  // this GC as it's not necessary to be on during reference processing.
+  _old_gen->par_oop_since_save_marks_iterate_done((int) worker_id);
 }
 
 ParNewGeneration::ParNewGeneration(ReservedSpace rs, size_t initial_byte_size)