diff src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp @ 6756:b2ef234911c9

7190666: G1: assert(_unused == 0) failed: Inconsistency in PLAB stats Summary: Reset the fields in ParGCAllocBuffer, that are used for accumulating values for the ResizePLAB sensors in PLABStats, to zero after flushing the values to the PLABStats fields. Flush PLABStats values only when retiring the final allocation buffers prior to disposing of a G1ParScanThreadState object, rather than when retiring every allocation buffer. Reviewed-by: jwilhelm, jmasa, ysr
author johnc
date Thu, 20 Sep 2012 09:52:56 -0700
parents aaf61e68b255
children 2e6857353b2c
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp	Wed Sep 19 15:48:02 2012 -0700
+++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp	Thu Sep 20 09:52:56 2012 -0700
@@ -90,7 +90,14 @@
 void PLABStats::adjust_desired_plab_sz() {
   assert(ResizePLAB, "Not set");
   if (_allocated == 0) {
-    assert(_unused == 0, "Inconsistency in PLAB stats");
+    assert(_unused == 0,
+           err_msg("Inconsistency in PLAB stats: "
+                   "_allocated: "SIZE_FORMAT", "
+                   "_wasted: "SIZE_FORMAT", "
+                   "_unused: "SIZE_FORMAT", "
+                   "_used  : "SIZE_FORMAT,
+                   _allocated, _wasted, _unused, _used));
+
     _allocated = 1;
   }
   double wasted_frac    = (double)_unused/(double)_allocated;