< prev index next >

test/gc/g1/TestHumongousShrinkHeap.java

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test TestHumongousShrinkHeap
  26  * @bug 8036025 8056043
  27  * @requires vm.gc.G1
  28  * @summary Verify that heap shrinks after GC in the presence of fragmentation
  29  * due to humongous objects
  30  * @library /testlibrary
  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.management/sun.management
  33  * @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10
  34  * -XX:MaxHeapFreeRatio=12 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc
  35  * TestHumongousShrinkHeap
  36  */
  37 
  38 import com.sun.management.HotSpotDiagnosticMXBean;
  39 import java.lang.management.ManagementFactory;
  40 import java.lang.management.MemoryUsage;
  41 import java.util.ArrayList;
  42 import java.util.List;
  43 import static jdk.test.lib.Asserts.*;
  44 
  45 public class TestHumongousShrinkHeap {
  46 
  47     public static final String MIN_FREE_RATIO_FLAG_NAME = "MinHeapFreeRatio";
  48     public static final String MAX_FREE_RATIO_FLAG_NAME = "MaxHeapFreeRatio";
  49 
  50     private static final List<List<byte[]>> garbage = new ArrayList();




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test TestHumongousShrinkHeap
  26  * @bug 8036025 8056043
  27  * @requires vm.gc.G1
  28  * @summary Verify that heap shrinks after GC in the presence of fragmentation
  29  * due to humongous objects
  30  * @library /test/lib
  31  * @modules java.base/jdk.internal.misc
  32  * @modules java.management/sun.management
  33  * @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10
  34  * -XX:MaxHeapFreeRatio=12 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc
  35  * TestHumongousShrinkHeap
  36  */
  37 
  38 import com.sun.management.HotSpotDiagnosticMXBean;
  39 import java.lang.management.ManagementFactory;
  40 import java.lang.management.MemoryUsage;
  41 import java.util.ArrayList;
  42 import java.util.List;
  43 import static jdk.test.lib.Asserts.*;
  44 
  45 public class TestHumongousShrinkHeap {
  46 
  47     public static final String MIN_FREE_RATIO_FLAG_NAME = "MinHeapFreeRatio";
  48     public static final String MAX_FREE_RATIO_FLAG_NAME = "MaxHeapFreeRatio";
  49 
  50     private static final List<List<byte[]>> garbage = new ArrayList();


< prev index next >