Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit

Permalink
8242041: Shenandoah: adaptive heuristics should account evac reserve …
Browse files Browse the repository at this point in the history
…in free target

Reviewed-by: rkennke
  • Loading branch information
shipilev committed Apr 2, 2020
1 parent 6570425 commit 487070c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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. // ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.


size_t capacity = ShenandoahHeap::heap()->max_capacity(); 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 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: " 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", SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ void ShenandoahTraversalHeuristics::choose_collection_set(ShenandoahCollectionSe


size_t capacity = heap->max_capacity(); size_t capacity = heap->max_capacity();
size_t actual_free = heap->free_set()->available(); 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 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: " 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", SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
Expand Down

0 comments on commit 487070c

Please sign in to comment.