< prev index next >

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

Print this page

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




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

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