8056043: Heap does not shrink within the heap after JDK-8038423
authortschatzl
Wed, 27 Aug 2014 08:59:05 +0200
changeset 26321 18d281f5acae
parent 26320 fc0a95c692f5
child 26323 febbfcc04db8
child 26326 d36e8d9dcac8
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: jwilhelm, jmasa
hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
hotspot/test/gc/g1/TestHumongousShrinkHeap.java
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp	Tue Aug 26 14:15:50 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp	Wed Aug 27 08:59:05 2014 +0200
@@ -351,10 +351,6 @@
 
   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);
--- a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java	Tue Aug 26 14:15:50 2014 +0200
+++ b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java	Wed Aug 27 08:59:05 2014 +0200
@@ -22,9 +22,8 @@
  */
 
 /**
- * @ignore 8041506, 8041946, 8042051
  * @test TestHumongousShrinkHeap
- * @bug 8036025
+ * @bug 8036025 8056043
  * @summary Verify that heap shrinks after GC in the presence of fragmentation due to humongous objects
  * @library /testlibrary
  * @run main/othervm -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc TestHumongousShrinkHeap