8222186: Shenandoah should not uncommit below minimum heap size

Reviewed-by: zgu, rkennke
This commit is contained in:
Aleksey Shipilev 2019-04-09 21:20:16 +02:00
parent 6453df40be
commit 321615029c
5 changed files with 54 additions and 9 deletions

View file

@ -462,9 +462,11 @@ void ShenandoahControlThread::service_stw_degenerated_cycle(GCCause::Cause cause
void ShenandoahControlThread::service_uncommit(double shrink_before) {
ShenandoahHeap* heap = ShenandoahHeap::heap();
// Scan through the heap and determine if there is work to do. This avoids taking
// heap lock if there is no work available, avoids spamming logs with superfluous
// logging messages, and minimises the amount of work while locks are taken.
// Determine if there is work to do. This avoids taking heap lock if there is
// no work available, avoids spamming logs with superfluous logging messages,
// and minimises the amount of work while locks are taken.
if (heap->committed() <= heap->min_capacity()) return;
bool has_work = false;
for (size_t i = 0; i < heap->num_regions(); i++) {