src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp

Print this page




 141       _allocated = 0;
 142       _wasted = 0;
 143     }
 144     // Retire the last allocation buffer.
 145     retire(end_of_gc, retain);
 146   }
 147 
 148   // Force future allocations to fail and queries for contains()
 149   // to return false
 150   void invalidate() {
 151     assert(!_retained, "Shouldn't retain an invalidated buffer.");
 152     _end    = _hard_end;
 153     _wasted += pointer_delta(_end, _top);  // unused  space
 154     _top    = _end;      // force future allocations to fail
 155     _bottom = _end;      // force future contains() queries to return false
 156   }
 157 
 158   // Fills in the unallocated portion of the buffer with a garbage object.
 159   // If "end_of_gc" is TRUE, is after the last use in the GC.  IF "retain"
 160   // is true, attempt to re-use the unused portion in the next GC.
 161   void retire(bool end_of_gc, bool retain);
 162 
 163   void print() PRODUCT_RETURN;
 164 };
 165 
 166 // PLAB stats book-keeping
 167 class PLABStats VALUE_OBJ_CLASS_SPEC {
 168   size_t _allocated;      // total allocated
 169   size_t _wasted;         // of which wasted (internal fragmentation)
 170   size_t _unused;         // Unused in last buffer
 171   size_t _used;           // derived = allocated - wasted - unused
 172   size_t _desired_plab_sz;// output of filter (below), suitably trimmed and quantized
 173   AdaptiveWeightedAverage
 174          _filter;         // integrator with decay
 175 
 176  public:
 177   PLABStats(size_t desired_plab_sz_, unsigned wt) :
 178     _allocated(0),
 179     _wasted(0),
 180     _unused(0),
 181     _used(0),




 141       _allocated = 0;
 142       _wasted = 0;
 143     }
 144     // Retire the last allocation buffer.
 145     retire(end_of_gc, retain);
 146   }
 147 
 148   // Force future allocations to fail and queries for contains()
 149   // to return false
 150   void invalidate() {
 151     assert(!_retained, "Shouldn't retain an invalidated buffer.");
 152     _end    = _hard_end;
 153     _wasted += pointer_delta(_end, _top);  // unused  space
 154     _top    = _end;      // force future allocations to fail
 155     _bottom = _end;      // force future contains() queries to return false
 156   }
 157 
 158   // Fills in the unallocated portion of the buffer with a garbage object.
 159   // If "end_of_gc" is TRUE, is after the last use in the GC.  IF "retain"
 160   // is true, attempt to re-use the unused portion in the next GC.
 161   virtual void retire(bool end_of_gc, bool retain);
 162 
 163   void print() PRODUCT_RETURN;
 164 };
 165 
 166 // PLAB stats book-keeping
 167 class PLABStats VALUE_OBJ_CLASS_SPEC {
 168   size_t _allocated;      // total allocated
 169   size_t _wasted;         // of which wasted (internal fragmentation)
 170   size_t _unused;         // Unused in last buffer
 171   size_t _used;           // derived = allocated - wasted - unused
 172   size_t _desired_plab_sz;// output of filter (below), suitably trimmed and quantized
 173   AdaptiveWeightedAverage
 174          _filter;         // integrator with decay
 175 
 176  public:
 177   PLABStats(size_t desired_plab_sz_, unsigned wt) :
 178     _allocated(0),
 179     _wasted(0),
 180     _unused(0),
 181     _used(0),