< prev index next >

test/gc/g1/TestHumongousShrinkHeap.java

Print this page




  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" | vm.gc=="null"
  28  * @summary Verify that heap shrinks after GC in the presence of fragmentation
  29  * due to humongous objects
  30  * @library /testlibrary

  31  * @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10
  32  * -XX:MaxHeapFreeRatio=12 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc
  33  * TestHumongousShrinkHeap
  34  */
  35 
  36 import java.lang.management.ManagementFactory;
  37 import java.lang.management.MemoryUsage;
  38 import java.util.ArrayList;
  39 import java.util.List;
  40 import sun.management.ManagementFactoryHelper;
  41 import static com.oracle.java.testlibrary.Asserts.*;
  42 
  43 public class TestHumongousShrinkHeap {
  44 
  45     public static final String MIN_FREE_RATIO_FLAG_NAME = "MinHeapFreeRatio";
  46     public static final String MAX_FREE_RATIO_FLAG_NAME = "MaxHeapFreeRatio";
  47 
  48     private static final List<List<byte[]>> garbage = new ArrayList();
  49     private static final int REGION_SIZE = 1024 * 1024; // 1M
  50     private static final int LISTS_COUNT = 10;




  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" | vm.gc=="null"
  28  * @summary Verify that heap shrinks after GC in the presence of fragmentation
  29  * due to humongous objects
  30  * @library /testlibrary
  31  * @build com.oracle.java.testlibrary.*
  32  * @run main/othervm -XX:-ExplicitGCInvokesConcurrent -XX:MinHeapFreeRatio=10
  33  * -XX:MaxHeapFreeRatio=12 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc
  34  * TestHumongousShrinkHeap
  35  */
  36 
  37 import java.lang.management.ManagementFactory;
  38 import java.lang.management.MemoryUsage;
  39 import java.util.ArrayList;
  40 import java.util.List;
  41 import sun.management.ManagementFactoryHelper;
  42 import static com.oracle.java.testlibrary.Asserts.*;
  43 
  44 public class TestHumongousShrinkHeap {
  45 
  46     public static final String MIN_FREE_RATIO_FLAG_NAME = "MinHeapFreeRatio";
  47     public static final String MAX_FREE_RATIO_FLAG_NAME = "MaxHeapFreeRatio";
  48 
  49     private static final List<List<byte[]>> garbage = new ArrayList();
  50     private static final int REGION_SIZE = 1024 * 1024; // 1M
  51     private static final int LISTS_COUNT = 10;


< prev index next >