diff src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents 2e6857353b2c
children 87c64c0438fb
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp	Mon Nov 12 18:11:17 2012 +0100
+++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp	Mon Nov 12 23:14:12 2012 +0100
@@ -52,6 +52,10 @@
   static size_t FillerHeaderSize;
   static size_t AlignmentReserve;
 
+  // Flush the stats supporting ergonomic sizing of PLAB's
+  // Should not be called directly
+  void flush_stats(PLABStats* stats);
+
 public:
   // Initializes the buffer to be empty, but with the given "word_sz".
   // Must get initialized with "set_buf" for an allocation to succeed.
@@ -120,12 +124,22 @@
   }
 
   // Flush the stats supporting ergonomic sizing of PLAB's
-  void flush_stats(PLABStats* stats);
+  // and retire the current buffer.
   void flush_stats_and_retire(PLABStats* stats, bool end_of_gc, bool retain) {
     // We flush the stats first in order to get a reading of
     // unused space in the last buffer.
     if (ResizePLAB) {
       flush_stats(stats);
+
+      // Since we have flushed the stats we need to clear
+      // the _allocated and _wasted fields. Not doing so
+      // will artifically inflate the values in the stats
+      // to which we add them.
+      // The next time we flush these values, we will add
+      // what we have just flushed in addition to the size
+      // of the buffers allocated between now and then.
+      _allocated = 0;
+      _wasted = 0;
     }
     // Retire the last allocation buffer.
     retire(end_of_gc, retain);
@@ -190,7 +204,8 @@
     return _desired_plab_sz;
   }
 
-  void adjust_desired_plab_sz(); // filter computation, latches output to
+  void adjust_desired_plab_sz(uint no_of_gc_workers);
+                                 // filter computation, latches output to
                                  // _desired_plab_sz, clears sensor accumulators
 
   void add_allocated(size_t v) {