Skip to content
Permalink
Browse files

8242041: Shenandoah: adaptive heuristics should account evac reserve …

…in free target

Reviewed-by: rkennke
  • Loading branch information
shipilev committed Apr 2, 2020
1 parent 6570425 commit 487070cc09749d3dee29367e1ae8063a259fb1b3
@@ -60,9 +60,9 @@ void ShenandoahAdaptiveHeuristics::choose_collection_set_from_regiondata(Shenand
// ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.

size_t capacity = ShenandoahHeap::heap()->max_capacity();
size_t free_target = capacity / 100 * ShenandoahMinFreeThreshold;
size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0;
size_t max_cset = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
size_t min_garbage = (free_target > actual_free ? (free_target - actual_free) : 0);

log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: "
SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
@@ -100,9 +100,10 @@ void ShenandoahTraversalHeuristics::choose_collection_set(ShenandoahCollectionSe

size_t capacity = heap->max_capacity();
size_t actual_free = heap->free_set()->available();
size_t free_target = capacity / 100 * ShenandoahMinFreeThreshold;
size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0;

size_t max_cset = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0;

log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: "
SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",

0 comments on commit 487070c

Please sign in to comment.