diff src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20215:983092f35ff7

8028710: G1 does not retire allocation buffers after reference processing work Summary: G1 does not retire allocation buffers after reference processing work when -XX:+ParallelRefProcEnabled is enabled. This causes wrong calculation of PLAB sizes, as the amount of space wasted is not updated correctly. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 09:40:19 +0200
parents d7e2d5f2846b
children 570cb6369f17
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Jul 21 09:40:19 2014 +0200
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Jul 21 09:40:19 2014 +0200
@@ -4571,7 +4571,7 @@
 }
 
 G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :
-  ParGCAllocBuffer(gclab_word_size), _retired(false) { }
+  ParGCAllocBuffer(gclab_word_size), _retired(true) { }
 
 G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp)
   : _g1h(g1h),
@@ -4935,8 +4935,6 @@
       pss->trim_queue();
     }
   } while (!offer_termination());
-
-  pss->retire_alloc_buffers();
 }
 
 class G1KlassScanClosure : public KlassClosure {
@@ -5776,10 +5774,8 @@
   }
 
   _gc_tracer_stw->report_gc_reference_stats(stats);
-  // We have completed copying any necessary live referent objects
-  // (that were not copied during the actual pause) so we can
-  // retire any active alloc buffers
-  pss.retire_alloc_buffers();
+
+  // We have completed copying any necessary live referent objects.
   assert(pss.refs()->is_empty(), "both queue and overflow should be empty");
 
   double ref_proc_time = os::elapsedTime() - ref_proc_start;