118 "undo waste: " SIZE_FORMAT "B, ",
119 _description,
120 _allocated * HeapWordSize,
121 _wasted * HeapWordSize,
122 _unused * HeapWordSize,
123 used() * HeapWordSize,
124 _undo_wasted * HeapWordSize);
125 }
126
127 void PLABStats::log_sizing(size_t calculated_words, size_t net_desired_words) {
128 log_debug(gc, plab)("%s sizing: "
129 "calculated: " SIZE_FORMAT "B, "
130 "actual: " SIZE_FORMAT "B",
131 _description,
132 calculated_words * HeapWordSize,
133 net_desired_words * HeapWordSize);
134 }
135
136 // Calculates plab size for current number of gc worker threads.
137 size_t PLABStats::desired_plab_sz(uint no_of_gc_workers) {
138 return align_object_size(MIN2(MAX2(min_size(), _desired_net_plab_sz / no_of_gc_workers), max_size()));
139 }
140
141 // Compute desired plab size for one gc worker thread and latch result for later
142 // use. This should be called once at the end of parallel
143 // scavenge; it clears the sensor accumulators.
144 void PLABStats::adjust_desired_plab_sz() {
145 log_plab_allocation();
146
147 if (!ResizePLAB) {
148 // Clear accumulators for next round.
149 reset();
150 return;
151 }
152
153 assert(is_object_aligned(max_size()) && min_size() <= max_size(),
154 "PLAB clipping computation may be incorrect");
155
156 assert(_allocated != 0 || _unused == 0,
157 "Inconsistency in PLAB stats: "
158 "_allocated: " SIZE_FORMAT ", "
|
118 "undo waste: " SIZE_FORMAT "B, ",
119 _description,
120 _allocated * HeapWordSize,
121 _wasted * HeapWordSize,
122 _unused * HeapWordSize,
123 used() * HeapWordSize,
124 _undo_wasted * HeapWordSize);
125 }
126
127 void PLABStats::log_sizing(size_t calculated_words, size_t net_desired_words) {
128 log_debug(gc, plab)("%s sizing: "
129 "calculated: " SIZE_FORMAT "B, "
130 "actual: " SIZE_FORMAT "B",
131 _description,
132 calculated_words * HeapWordSize,
133 net_desired_words * HeapWordSize);
134 }
135
136 // Calculates plab size for current number of gc worker threads.
137 size_t PLABStats::desired_plab_sz(uint no_of_gc_workers) {
138 return align_object_size(clamp(_desired_net_plab_sz / no_of_gc_workers, min_size(), max_size()));
139 }
140
141 // Compute desired plab size for one gc worker thread and latch result for later
142 // use. This should be called once at the end of parallel
143 // scavenge; it clears the sensor accumulators.
144 void PLABStats::adjust_desired_plab_sz() {
145 log_plab_allocation();
146
147 if (!ResizePLAB) {
148 // Clear accumulators for next round.
149 reset();
150 return;
151 }
152
153 assert(is_object_aligned(max_size()) && min_size() <= max_size(),
154 "PLAB clipping computation may be incorrect");
155
156 assert(_allocated != 0 || _unused == 0,
157 "Inconsistency in PLAB stats: "
158 "_allocated: " SIZE_FORMAT ", "
|