src/share/vm/gc_implementation/g1/heapRegionManager.cpp

Print this page
rev 6926 : 8056043: Heap does not shrink within the heap after JDK-8038423
Summary: Enable shrinking within the heap by removing some code added for JDK-8054818. Enable the test case that checks that again too.
Reviewed-by:

@@ -349,14 +349,10 @@
   uint idx_last_found = 0;
   uint num_last_found = 0;
 
   while ((removed < num_regions_to_remove) &&
       (num_last_found = find_empty_from_idx_reverse(cur, &idx_last_found)) > 0) {
-    // Only allow uncommit from the end of the heap.
-    if ((idx_last_found + num_last_found) != _allocated_heapregions_length) {
-      return 0;
-    }
     uint to_remove = MIN2(num_regions_to_remove - removed, num_last_found);
 
     uncommit_regions(idx_last_found + num_last_found - to_remove, to_remove);
 
     cur -= num_last_found;