hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java
changeset 31522 2d29f2e927fc
parent 31413 96a5b57297a3
child 33730 30e064828045
equal deleted inserted replaced
31414:20e05afbc7af 31522:2d29f2e927fc
    25 import java.lang.management.MemoryPoolMXBean;
    25 import java.lang.management.MemoryPoolMXBean;
    26 import sun.hotspot.code.BlobType;
    26 import sun.hotspot.code.BlobType;
    27 
    27 
    28 /*
    28 /*
    29  * @test UsageThresholdIncreasedTest
    29  * @test UsageThresholdIncreasedTest
    30  * @ignore 8129937
       
    31  * @library /testlibrary /../../test/lib
    30  * @library /testlibrary /../../test/lib
    32  * @modules java.base/sun.misc
    31  * @modules java.base/sun.misc
    33  *          java.management
    32  *          java.management
    34  * @build UsageThresholdIncreasedTest
    33  * @build UsageThresholdIncreasedTest
    35  * @run main ClassFileInstaller sun.hotspot.WhiteBox
    34  * @run main ClassFileInstaller sun.hotspot.WhiteBox
    52         this.btype = btype;
    51         this.btype = btype;
    53     }
    52     }
    54 
    53 
    55     public static void main(String[] args) {
    54     public static void main(String[] args) {
    56         for (BlobType btype : BlobType.getAvailable()) {
    55         for (BlobType btype : BlobType.getAvailable()) {
    57             if (CodeCacheUtils.isCodeHeapPredictable(btype)) {
    56             new UsageThresholdIncreasedTest(btype).runTest();
    58                 new UsageThresholdIncreasedTest(btype).runTest();
       
    59             }
       
    60         }
    57         }
    61     }
    58     }
    62 
    59 
    63     private void checkUsageThresholdCount(MemoryPoolMXBean bean, long count){
    60     private void checkUsageThresholdCount(MemoryPoolMXBean bean, long count){
    64         Asserts.assertEQ(bean.getUsageThresholdCount(), count,
    61         CodeCacheUtils.assertEQorGTE(btype, bean.getUsageThresholdCount(), count,
    65                 String.format("Usage threshold was hit: %d times for %s "
    62                 String.format("Usage threshold was hit: %d times for %s "
    66                         + "Threshold value: %d with current usage: %d",
    63                         + "Threshold value: %d with current usage: %d",
    67                         bean.getUsageThresholdCount(), bean.getName(),
    64                         bean.getUsageThresholdCount(), bean.getName(),
    68                         bean.getUsageThreshold(), bean.getUsage().getUsed()));
    65                         bean.getUsageThreshold(), bean.getUsage().getUsed()));
    69     }
    66     }