< prev index next >

src/hotspot/share/gc/shared/plab.hpp

Print this page

123     assert(new_word_sz > AlignmentReserve, "Too small");
124     _word_sz = new_word_sz;
125 
126     _bottom   = buf;
127     _top      = _bottom;
128     _hard_end = _bottom + word_sz();
129     _end      = _hard_end - AlignmentReserve;
130     assert(_end >= _top, "Negative buffer");
131     // In support of ergonomic sizing
132     _allocated += word_sz();
133   }
134 
135   // Flush allocation statistics into the given PLABStats supporting ergonomic
136   // sizing of PLAB's and retire the current buffer. To be called at the end of
137   // GC.
138   void flush_and_retire_stats(PLABStats* stats);
139 
140   // Fills in the unallocated portion of the buffer with a garbage object and updates
141   // statistics. To be called during GC.
142   void retire();




143 };
144 
145 // PLAB book-keeping.
146 class PLABStats : public CHeapObj<mtGC> {
147  protected:
148   const char* _description;   // Identifying string.
149 
150   size_t _allocated;          // Total allocated
151   size_t _wasted;             // of which wasted (internal fragmentation)
152   size_t _undo_wasted;        // of which wasted on undo (is not used for calculation of PLAB size)
153   size_t _unused;             // Unused in last buffer
154   size_t _default_plab_sz;
155   size_t _desired_net_plab_sz;// Output of filter (below), suitably trimmed and quantized
156   AdaptiveWeightedAverage
157          _filter;             // Integrator with decay
158 
159   virtual void reset() {
160     _allocated   = 0;
161     _wasted      = 0;
162     _undo_wasted = 0;

123     assert(new_word_sz > AlignmentReserve, "Too small");
124     _word_sz = new_word_sz;
125 
126     _bottom   = buf;
127     _top      = _bottom;
128     _hard_end = _bottom + word_sz();
129     _end      = _hard_end - AlignmentReserve;
130     assert(_end >= _top, "Negative buffer");
131     // In support of ergonomic sizing
132     _allocated += word_sz();
133   }
134 
135   // Flush allocation statistics into the given PLABStats supporting ergonomic
136   // sizing of PLAB's and retire the current buffer. To be called at the end of
137   // GC.
138   void flush_and_retire_stats(PLABStats* stats);
139 
140   // Fills in the unallocated portion of the buffer with a garbage object and updates
141   // statistics. To be called during GC.
142   void retire();
143 
144   HeapWord* top() {
145     return _top;
146   }
147 };
148 
149 // PLAB book-keeping.
150 class PLABStats : public CHeapObj<mtGC> {
151  protected:
152   const char* _description;   // Identifying string.
153 
154   size_t _allocated;          // Total allocated
155   size_t _wasted;             // of which wasted (internal fragmentation)
156   size_t _undo_wasted;        // of which wasted on undo (is not used for calculation of PLAB size)
157   size_t _unused;             // Unused in last buffer
158   size_t _default_plab_sz;
159   size_t _desired_net_plab_sz;// Output of filter (below), suitably trimmed and quantized
160   AdaptiveWeightedAverage
161          _filter;             // Integrator with decay
162 
163   virtual void reset() {
164     _allocated   = 0;
165     _wasted      = 0;
166     _undo_wasted = 0;
< prev index next >