< prev index next >

test/gc/g1/humongousObjects/TestHeapCounters.java

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 package gc.g1.humongousObjects;
  26 
  27 import gc.testlibrary.Helpers;
  28 import jdk.test.lib.Asserts;
  29 import sun.hotspot.WhiteBox;
  30 
  31 import java.lang.management.GarbageCollectorMXBean;
  32 import java.lang.management.ManagementFactory;
  33 import java.util.ArrayList;
  34 import java.util.Arrays;
  35 import java.util.List;
  36 
  37 /**
  38  * @test TestHeapCounters
  39  * @summary Checks that heap counters work as expected after humongous allocations/deallocations
  40  * @requires vm.gc.G1
  41  * @library /testlibrary /test/lib /
  42  * @modules java.base/jdk.internal.misc
  43  * @modules java.management
  44  * @build sun.hotspot.WhiteBox
  45  *        gc.testlibrary.Helpers
  46  *        gc.g1.humongousObjects.TestHeapCounters
  47  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  48  *             sun.hotspot.WhiteBox$WhiteBoxPermission
  49  *
  50  * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  51  *                   -Xmx128m -Xms128m
  52  *                   -XX:G1HeapRegionSize=1M -XX:InitiatingHeapOccupancyPercent=100 -XX:-G1UseAdaptiveIHOP
  53  *                   -Xlog:gc -Xlog:gc:file=TestHeapCountersRuntime.gc.log
  54  *                    gc.g1.humongousObjects.TestHeapCounters RUNTIME_COUNTER
  55  *
  56  * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  57  *                   -Xmx128m -Xms128m
  58  *                   -XX:G1HeapRegionSize=1M -XX:InitiatingHeapOccupancyPercent=100 -XX:-G1UseAdaptiveIHOP
  59  *                   -Xlog:gc -Xlog:gc:file=TestHeapCountersMXBean.gc.log
  60  *                    gc.g1.humongousObjects.TestHeapCounters MX_BEAN_COUNTER
  61  */
  62 public class TestHeapCounters {
  63     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
  64     private static final int G1_REGION_SIZE = WHITE_BOX.g1RegionSize();
  65     private static final int HALF_G1_REGION_SIZE = G1_REGION_SIZE / 2;
  66 




  21  * questions.
  22  *
  23  */
  24 
  25 package gc.g1.humongousObjects;
  26 
  27 import gc.testlibrary.Helpers;
  28 import jdk.test.lib.Asserts;
  29 import sun.hotspot.WhiteBox;
  30 
  31 import java.lang.management.GarbageCollectorMXBean;
  32 import java.lang.management.ManagementFactory;
  33 import java.util.ArrayList;
  34 import java.util.Arrays;
  35 import java.util.List;
  36 
  37 /**
  38  * @test TestHeapCounters
  39  * @summary Checks that heap counters work as expected after humongous allocations/deallocations
  40  * @requires vm.gc.G1
  41  * @library /test/lib /
  42  * @modules java.base/jdk.internal.misc
  43  * @modules java.management
  44  * @build sun.hotspot.WhiteBox


  45  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  46  *             sun.hotspot.WhiteBox$WhiteBoxPermission
  47  *
  48  * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  49  *                   -Xmx128m -Xms128m
  50  *                   -XX:G1HeapRegionSize=1M -XX:InitiatingHeapOccupancyPercent=100 -XX:-G1UseAdaptiveIHOP
  51  *                   -Xlog:gc -Xlog:gc:file=TestHeapCountersRuntime.gc.log
  52  *                    gc.g1.humongousObjects.TestHeapCounters RUNTIME_COUNTER
  53  *
  54  * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  55  *                   -Xmx128m -Xms128m
  56  *                   -XX:G1HeapRegionSize=1M -XX:InitiatingHeapOccupancyPercent=100 -XX:-G1UseAdaptiveIHOP
  57  *                   -Xlog:gc -Xlog:gc:file=TestHeapCountersMXBean.gc.log
  58  *                    gc.g1.humongousObjects.TestHeapCounters MX_BEAN_COUNTER
  59  */
  60 public class TestHeapCounters {
  61     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
  62     private static final int G1_REGION_SIZE = WHITE_BOX.g1RegionSize();
  63     private static final int HALF_G1_REGION_SIZE = G1_REGION_SIZE / 2;
  64 


< prev index next >