src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
changeset 54478 cdc54443fee5
parent 53403 683a112e0e1e
child 54623 1126f0607c70
--- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp	Tue Apr 09 21:20:15 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp	Tue Apr 09 21:20:16 2019 +0200
@@ -462,9 +462,11 @@
 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++) {