< prev index next >

src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp

Print this page

 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 
 27 #include "gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp"
 28 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
 29 #include "gc/shenandoah/shenandoahFreeSet.hpp"
 30 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
 31 #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
 32 #include "logging/log.hpp"
 33 #include "logging/logTag.hpp"
 34 #include "utilities/quickSort.hpp"
 35 
 36 // These constants are used to adjust the margin of error for the moving
 37 // average of the allocation rate and cycle time. The units are standard
 38 // deviations.
 39 const double ShenandoahAdaptiveHeuristics::FULL_PENALTY_SD = 0.2;
 40 const double ShenandoahAdaptiveHeuristics::DEGENERATE_PENALTY_SD = 0.1;
 41 
 42 // These are used to decide if we want to make any adjustments at all
 43 // at the end of a successful concurrent cycle.
 44 const double ShenandoahAdaptiveHeuristics::LOWEST_EXPECTED_AVAILABLE_AT_END = -0.5;
 45 const double ShenandoahAdaptiveHeuristics::HIGHEST_EXPECTED_AVAILABLE_AT_END = 0.5;
 46 
 47 // These values are the confidence interval expressed as standard deviations.
 48 // At the minimum confidence level, there is a 25% chance that the true value of
 49 // the estimate (average cycle time or allocation rate) is not more than
 50 // MINIMUM_CONFIDENCE standard deviations away from our estimate. Similarly, the
 51 // MAXIMUM_CONFIDENCE interval here means there is a one in a thousand chance
 52 // that the true value of our estimate is outside the interval. These are used
 53 // as bounds on the adjustments applied at the outcome of a GC cycle.
 54 const double ShenandoahAdaptiveHeuristics::MINIMUM_CONFIDENCE = 0.319; // 25%
 55 const double ShenandoahAdaptiveHeuristics::MAXIMUM_CONFIDENCE = 3.291; // 99.9%
 56 
 57 ShenandoahAdaptiveHeuristics::ShenandoahAdaptiveHeuristics() :
 58   ShenandoahHeuristics(),
 59   _margin_of_error_sd(ShenandoahAdaptiveInitialConfidence),
 60   _spike_threshold_sd(ShenandoahAdaptiveInitialSpikeThreshold),
 61   _last_trigger(OTHER) { }
 62 
 63 ShenandoahAdaptiveHeuristics::~ShenandoahAdaptiveHeuristics() {}
 64 
 65 void ShenandoahAdaptiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset,
 66                                                                          RegionData* data, size_t size,
 67                                                                          size_t actual_free) {
 68   size_t garbage_threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahGarbageThreshold / 100;
 69 
 70   // The logic for cset selection in adaptive is as follows:
 71   //
 72   //   1. We cannot get cset larger than available free space. Otherwise we guarantee OOME
 73   //      during evacuation, and thus guarantee full GC. In practice, we also want to let
 74   //      application to allocate something. This is why we limit CSet to some fraction of
 75   //      available space. In non-overloaded heap, max_cset would contain all plausible candidates
 76   //      over garbage threshold.
 77   //
 78   //   2. We should not get cset too low so that free threshold would not be met right
 79   //      after the cycle. Otherwise we get back-to-back cycles for no reason if heap is
 80   //      too fragmented. In non-overloaded non-fragmented heap min_garbage would be around zero.
 81   //
 82   // Therefore, we start by sorting the regions by garbage. Then we unconditionally add the best candidates
 83   // before we meet min_garbage. Then we add all candidates that fit with a garbage threshold before
 84   // we hit max_cset. When max_cset is hit, we terminate the cset selection. Note that in this scheme,
 85   // ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.
 86 
 87   size_t capacity    = ShenandoahHeap::heap()->soft_max_capacity();
 88   size_t max_cset    = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
 89   size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
 90   size_t min_garbage = (free_target > actual_free ? (free_target - actual_free) : 0);
 91 
 92   log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: "
 93                      SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
 94                      byte_size_in_proper_unit(free_target), proper_unit_for_byte_size(free_target),
 95                      byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),
 96                      byte_size_in_proper_unit(max_cset),    proper_unit_for_byte_size(max_cset),
 97                      byte_size_in_proper_unit(min_garbage), proper_unit_for_byte_size(min_garbage));
 98 
 99   // Better select garbage-first regions
100   QuickSort::sort<RegionData>(data, (int)size, compare_by_garbage, false);
101 
102   size_t cur_cset = 0;
103   size_t cur_garbage = 0;
104 
105   for (size_t idx = 0; idx < size; idx++) {
106     ShenandoahHeapRegion* r = data[idx]._region;
107 

179   ShenandoahHeuristics::record_success_degenerated();
180   // Adjust both trigger's parameters in the case of a degenerated GC because
181   // either of them should have triggered earlier to avoid this case.
182   adjust_margin_of_error(DEGENERATE_PENALTY_SD);
183   adjust_spike_threshold(DEGENERATE_PENALTY_SD);
184 }
185 
186 void ShenandoahAdaptiveHeuristics::record_success_full() {
187   ShenandoahHeuristics::record_success_full();
188   // Adjust both trigger's parameters in the case of a full GC because
189   // either of them should have triggered earlier to avoid this case.
190   adjust_margin_of_error(FULL_PENALTY_SD);
191   adjust_spike_threshold(FULL_PENALTY_SD);
192 }
193 
194 static double saturate(double value, double min, double max) {
195   return MAX2(MIN2(value, max), min);
196 }
197 
198 bool ShenandoahAdaptiveHeuristics::should_start_gc() {
199   ShenandoahHeap* heap = ShenandoahHeap::heap();
200   size_t max_capacity = heap->max_capacity();
201   size_t capacity = heap->soft_max_capacity();
202   size_t available = heap->free_set()->available();
203   size_t allocated = heap->bytes_allocated_since_gc_start();



204 
205   // Make sure the code below treats available without the soft tail.
206   size_t soft_tail = max_capacity - capacity;
207   available = (available > soft_tail) ? (available - soft_tail) : 0;
208 
209   // Track allocation rate even if we decide to start a cycle for other reasons.
210   double rate = _allocation_rate.sample(allocated);
211   _last_trigger = OTHER;
212 
213   size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;




214   if (available < min_threshold) {
215     log_info(gc)("Trigger: Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",

216                  byte_size_in_proper_unit(available),     proper_unit_for_byte_size(available),
217                  byte_size_in_proper_unit(min_threshold), proper_unit_for_byte_size(min_threshold));
218     return true;
219   }
220 

221   const size_t max_learn = ShenandoahLearningSteps;
222   if (_gc_times_learned < max_learn) {
223     size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold;
224     if (available < init_threshold) {
225       log_info(gc)("Trigger: Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "%s) is below initial threshold (" SIZE_FORMAT "%s)",
226                    _gc_times_learned + 1, max_learn,
227                    byte_size_in_proper_unit(available),      proper_unit_for_byte_size(available),
228                    byte_size_in_proper_unit(init_threshold), proper_unit_for_byte_size(init_threshold));
229       return true;
230     }
231   }
232 
233   // Check if allocation headroom is still okay. This also factors in:
234   //   1. Some space to absorb allocation spikes
235   //   2. Accumulated penalties from Degenerated and Full GC
236   size_t allocation_headroom = available;
237 
238   size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor;
239   size_t penalties      = capacity / 100 * _gc_time_penalties;
240 
241   allocation_headroom -= MIN2(allocation_headroom, spike_headroom);
242   allocation_headroom -= MIN2(allocation_headroom, penalties);
243 
244   double avg_cycle_time = _gc_time_history->davg() + (_margin_of_error_sd * _gc_time_history->dsd());
245   double avg_alloc_rate = _allocation_rate.upper_bound(_margin_of_error_sd);



246   if (avg_cycle_time > allocation_headroom / avg_alloc_rate) {
247     log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for average allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (margin of error = %.2f)",
248                  avg_cycle_time * 1000,
249                  byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate),
250                  byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
251                  _margin_of_error_sd);
252 
253     log_info(gc, ergo)("Free headroom: " SIZE_FORMAT "%s (free) - " SIZE_FORMAT "%s (spike) - " SIZE_FORMAT "%s (penalties) = " SIZE_FORMAT "%s",
254                        byte_size_in_proper_unit(available),           proper_unit_for_byte_size(available),
255                        byte_size_in_proper_unit(spike_headroom),      proper_unit_for_byte_size(spike_headroom),
256                        byte_size_in_proper_unit(penalties),           proper_unit_for_byte_size(penalties),
257                        byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom));
258 
259     _last_trigger = RATE;
260     return true;
261   }
262 
263   bool is_spiking = _allocation_rate.is_spiking(rate, _spike_threshold_sd);
264   if (is_spiking && avg_cycle_time > allocation_headroom / rate) {
265     log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for instantaneous allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (spike threshold = %.2f)",
266                  avg_cycle_time * 1000,
267                  byte_size_in_proper_unit(rate), proper_unit_for_byte_size(rate),
268                  byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
269                  _spike_threshold_sd);
270     _last_trigger = SPIKE;
271     return true;
272   }
273 
274   return ShenandoahHeuristics::should_start_gc();
275 }
276 
277 void ShenandoahAdaptiveHeuristics::adjust_last_trigger_parameters(double amount) {
278   switch (_last_trigger) {
279     case RATE:
280       adjust_margin_of_error(amount);
281       break;
282     case SPIKE:
283       adjust_spike_threshold(amount);
284       break;
285     case OTHER:
286       // nothing to adjust here.

 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 
 27 #include "gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp"
 28 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
 29 #include "gc/shenandoah/shenandoahFreeSet.hpp"
 30 #include "gc/shenandoah/shenandoahGeneration.hpp"
 31 #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
 32 #include "logging/log.hpp"
 33 #include "logging/logTag.hpp"
 34 #include "utilities/quickSort.hpp"
 35 
 36 // These constants are used to adjust the margin of error for the moving
 37 // average of the allocation rate and cycle time. The units are standard
 38 // deviations.
 39 const double ShenandoahAdaptiveHeuristics::FULL_PENALTY_SD = 0.2;
 40 const double ShenandoahAdaptiveHeuristics::DEGENERATE_PENALTY_SD = 0.1;
 41 
 42 // These are used to decide if we want to make any adjustments at all
 43 // at the end of a successful concurrent cycle.
 44 const double ShenandoahAdaptiveHeuristics::LOWEST_EXPECTED_AVAILABLE_AT_END = -0.5;
 45 const double ShenandoahAdaptiveHeuristics::HIGHEST_EXPECTED_AVAILABLE_AT_END = 0.5;
 46 
 47 // These values are the confidence interval expressed as standard deviations.
 48 // At the minimum confidence level, there is a 25% chance that the true value of
 49 // the estimate (average cycle time or allocation rate) is not more than
 50 // MINIMUM_CONFIDENCE standard deviations away from our estimate. Similarly, the
 51 // MAXIMUM_CONFIDENCE interval here means there is a one in a thousand chance
 52 // that the true value of our estimate is outside the interval. These are used
 53 // as bounds on the adjustments applied at the outcome of a GC cycle.
 54 const double ShenandoahAdaptiveHeuristics::MINIMUM_CONFIDENCE = 0.319; // 25%
 55 const double ShenandoahAdaptiveHeuristics::MAXIMUM_CONFIDENCE = 3.291; // 99.9%
 56 
 57 ShenandoahAdaptiveHeuristics::ShenandoahAdaptiveHeuristics(ShenandoahGeneration* generation) :
 58   ShenandoahHeuristics(generation),
 59   _margin_of_error_sd(ShenandoahAdaptiveInitialConfidence),
 60   _spike_threshold_sd(ShenandoahAdaptiveInitialSpikeThreshold),
 61   _last_trigger(OTHER) { }
 62 
 63 ShenandoahAdaptiveHeuristics::~ShenandoahAdaptiveHeuristics() {}
 64 
 65 void ShenandoahAdaptiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* cset,
 66                                                                          RegionData* data, size_t size,
 67                                                                          size_t actual_free) {
 68   size_t garbage_threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahGarbageThreshold / 100;
 69 
 70   // The logic for cset selection in adaptive is as follows:
 71   //
 72   //   1. We cannot get cset larger than available free space. Otherwise we guarantee OOME
 73   //      during evacuation, and thus guarantee full GC. In practice, we also want to let
 74   //      application to allocate something. This is why we limit CSet to some fraction of
 75   //      available space. In non-overloaded heap, max_cset would contain all plausible candidates
 76   //      over garbage threshold.
 77   //
 78   //   2. We should not get cset too low so that free threshold would not be met right
 79   //      after the cycle. Otherwise we get back-to-back cycles for no reason if heap is
 80   //      too fragmented. In non-overloaded non-fragmented heap min_garbage would be around zero.
 81   //
 82   // Therefore, we start by sorting the regions by garbage. Then we unconditionally add the best candidates
 83   // before we meet min_garbage. Then we add all candidates that fit with a garbage threshold before
 84   // we hit max_cset. When max_cset is hit, we terminate the cset selection. Note that in this scheme,
 85   // ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.
 86 
 87   size_t capacity    = _generation->soft_max_capacity();
 88   size_t max_cset    = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
 89   size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
 90   size_t min_garbage = (free_target > actual_free ? (free_target - actual_free) : 0);
 91 
 92   log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: "
 93                      SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
 94                      byte_size_in_proper_unit(free_target), proper_unit_for_byte_size(free_target),
 95                      byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),
 96                      byte_size_in_proper_unit(max_cset),    proper_unit_for_byte_size(max_cset),
 97                      byte_size_in_proper_unit(min_garbage), proper_unit_for_byte_size(min_garbage));
 98 
 99   // Better select garbage-first regions
100   QuickSort::sort<RegionData>(data, (int)size, compare_by_garbage, false);
101 
102   size_t cur_cset = 0;
103   size_t cur_garbage = 0;
104 
105   for (size_t idx = 0; idx < size; idx++) {
106     ShenandoahHeapRegion* r = data[idx]._region;
107 

179   ShenandoahHeuristics::record_success_degenerated();
180   // Adjust both trigger's parameters in the case of a degenerated GC because
181   // either of them should have triggered earlier to avoid this case.
182   adjust_margin_of_error(DEGENERATE_PENALTY_SD);
183   adjust_spike_threshold(DEGENERATE_PENALTY_SD);
184 }
185 
186 void ShenandoahAdaptiveHeuristics::record_success_full() {
187   ShenandoahHeuristics::record_success_full();
188   // Adjust both trigger's parameters in the case of a full GC because
189   // either of them should have triggered earlier to avoid this case.
190   adjust_margin_of_error(FULL_PENALTY_SD);
191   adjust_spike_threshold(FULL_PENALTY_SD);
192 }
193 
194 static double saturate(double value, double min, double max) {
195   return MAX2(MIN2(value, max), min);
196 }
197 
198 bool ShenandoahAdaptiveHeuristics::should_start_gc() {
199   size_t max_capacity = _generation->max_capacity();
200   size_t capacity = _generation->soft_max_capacity();
201   size_t available = _generation->available();
202   size_t allocated = _generation->bytes_allocated_since_gc_start();
203 
204   log_debug(gc)("should_start_gc (%s)? available: " SIZE_FORMAT ", soft_max_capacity: " SIZE_FORMAT
205                 ", max_capacity: " SIZE_FORMAT ", allocated: " SIZE_FORMAT,
206                 _generation->name(), available, capacity, max_capacity, allocated);
207 
208   // Make sure the code below treats available without the soft tail.
209   size_t soft_tail = max_capacity - capacity;
210   available = (available > soft_tail) ? (available - soft_tail) : 0;
211 
212   // Track allocation rate even if we decide to start a cycle for other reasons.
213   double rate = _allocation_rate.sample(allocated);
214   _last_trigger = OTHER;
215 
216   size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;
217 
218   log_debug(gc)("  available adjusted to: " SIZE_FORMAT ", min_threshold: " SIZE_FORMAT ", ShenandoahMinFreeThreshold: " SIZE_FORMAT,
219                 available, min_threshold, ShenandoahMinFreeThreshold);
220 
221   if (available < min_threshold) {
222     log_info(gc)("Trigger (%s): Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",
223                  _generation->name(),
224                  byte_size_in_proper_unit(available),     proper_unit_for_byte_size(available),
225                  byte_size_in_proper_unit(min_threshold), proper_unit_for_byte_size(min_threshold));
226     return true;
227   }
228 
229   // Check if we need to learn a bit about the application
230   const size_t max_learn = ShenandoahLearningSteps;
231   if (_gc_times_learned < max_learn) {
232     size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold;
233     if (available < init_threshold) {
234       log_info(gc)("Trigger (%s): Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "%s) is below initial threshold (" SIZE_FORMAT "%s)",
235                    _generation->name(), _gc_times_learned + 1, max_learn,
236                    byte_size_in_proper_unit(available),      proper_unit_for_byte_size(available),
237                    byte_size_in_proper_unit(init_threshold), proper_unit_for_byte_size(init_threshold));
238       return true;
239     }
240   }
241 
242   // Check if allocation headroom is still okay. This also factors in:
243   //   1. Some space to absorb allocation spikes
244   //   2. Accumulated penalties from Degenerated and Full GC
245   size_t allocation_headroom = available;
246 
247   size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor;
248   size_t penalties      = capacity / 100 * _gc_time_penalties;
249 
250   allocation_headroom -= MIN2(allocation_headroom, spike_headroom);
251   allocation_headroom -= MIN2(allocation_headroom, penalties);
252 
253   double avg_cycle_time = _gc_time_history->davg() + (_margin_of_error_sd * _gc_time_history->dsd());
254   double avg_alloc_rate = _allocation_rate.upper_bound(_margin_of_error_sd);
255   log_debug(gc)("%s: average GC time: %.2f ms, allocation rate: %.0f %s/s",
256     _generation->name(), avg_cycle_time * 1000, byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate));
257 
258   if (avg_cycle_time > allocation_headroom / avg_alloc_rate) {
259     log_info(gc)("Trigger (%s): Average GC time (%.2f ms) is above the time for average allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (margin of error = %.2f)",
260                  _generation->name(), avg_cycle_time * 1000,
261                  byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate),
262                  byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
263                  _margin_of_error_sd);
264 
265     log_info(gc, ergo)("Free headroom: " SIZE_FORMAT "%s (free) - " SIZE_FORMAT "%s (spike) - " SIZE_FORMAT "%s (penalties) = " SIZE_FORMAT "%s",
266                        byte_size_in_proper_unit(available),           proper_unit_for_byte_size(available),
267                        byte_size_in_proper_unit(spike_headroom),      proper_unit_for_byte_size(spike_headroom),
268                        byte_size_in_proper_unit(penalties),           proper_unit_for_byte_size(penalties),
269                        byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom));
270 
271     _last_trigger = RATE;
272     return true;
273   }
274 
275   bool is_spiking = _allocation_rate.is_spiking(rate, _spike_threshold_sd);
276   if (is_spiking && avg_cycle_time > allocation_headroom / rate) {
277     log_info(gc)("Trigger (%s): Average GC time (%.2f ms) is above the time for instantaneous allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (spike threshold = %.2f)",
278                  _generation->name(), avg_cycle_time * 1000,
279                  byte_size_in_proper_unit(rate), proper_unit_for_byte_size(rate),
280                  byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
281                  _spike_threshold_sd);
282     _last_trigger = SPIKE;
283     return true;
284   }
285 
286   return ShenandoahHeuristics::should_start_gc();
287 }
288 
289 void ShenandoahAdaptiveHeuristics::adjust_last_trigger_parameters(double amount) {
290   switch (_last_trigger) {
291     case RATE:
292       adjust_margin_of_error(amount);
293       break;
294     case SPIKE:
295       adjust_spike_threshold(amount);
296       break;
297     case OTHER:
298       // nothing to adjust here.
< prev index next >