< prev index next >

test/compiler/codecache/jmx/PeakUsageTest.java

Print this page

        

*** 50,92 **** this.btype = btype; } public static void main(String[] args) { for (BlobType btype : BlobType.getAvailable()) { - if (CodeCacheUtils.isCodeHeapPredictable(btype)) { new PeakUsageTest(btype).runTest(); } } - } protected void runTest() { MemoryPoolMXBean bean = btype.getMemoryPool(); bean.resetPeakUsage(); long addr = CodeCacheUtils.WB.allocateCodeBlob( CodeCacheUtils.ALLOCATION_SIZE, btype.id); long newPeakUsage = bean.getPeakUsage().getUsed(); try { ! Asserts.assertEQ(newPeakUsage, bean.getUsage().getUsed(), "Peak usage does not match usage after allocation for " + bean.getName()); } finally { if (addr != 0) { CodeCacheUtils.WB.freeCodeBlob(addr); } } ! Asserts.assertEQ(newPeakUsage, bean.getPeakUsage().getUsed(), "Code cache peak usage has changed after usage decreased for " + bean.getName()); bean.resetPeakUsage(); ! Asserts.assertEQ(bean.getPeakUsage().getUsed(), bean.getUsage().getUsed(), "Code cache peak usage is not equal to usage after reset for " + bean.getName()); long addr2 = CodeCacheUtils.WB.allocateCodeBlob( CodeCacheUtils.ALLOCATION_SIZE, btype.id); try { ! Asserts.assertEQ(bean.getPeakUsage().getUsed(), bean.getUsage().getUsed(), "Code cache peak usage is not equal to usage after fresh " + "allocation for " + bean.getName()); } finally { if (addr2 != 0) { --- 50,90 ---- this.btype = btype; } public static void main(String[] args) { for (BlobType btype : BlobType.getAvailable()) { new PeakUsageTest(btype).runTest(); } } protected void runTest() { MemoryPoolMXBean bean = btype.getMemoryPool(); bean.resetPeakUsage(); long addr = CodeCacheUtils.WB.allocateCodeBlob( CodeCacheUtils.ALLOCATION_SIZE, btype.id); long newPeakUsage = bean.getPeakUsage().getUsed(); try { ! CodeCacheUtils.assertEQorGTE(btype, newPeakUsage, bean.getUsage().getUsed(), "Peak usage does not match usage after allocation for " + bean.getName()); } finally { if (addr != 0) { CodeCacheUtils.WB.freeCodeBlob(addr); } } ! CodeCacheUtils.assertEQorGTE(btype, newPeakUsage, bean.getPeakUsage().getUsed(), "Code cache peak usage has changed after usage decreased for " + bean.getName()); bean.resetPeakUsage(); ! CodeCacheUtils.assertEQorGTE(btype, bean.getPeakUsage().getUsed(), bean.getUsage().getUsed(), "Code cache peak usage is not equal to usage after reset for " + bean.getName()); long addr2 = CodeCacheUtils.WB.allocateCodeBlob( CodeCacheUtils.ALLOCATION_SIZE, btype.id); try { ! CodeCacheUtils.assertEQorGTE(btype, bean.getPeakUsage().getUsed(), bean.getUsage().getUsed(), "Code cache peak usage is not equal to usage after fresh " + "allocation for " + bean.getName()); } finally { if (addr2 != 0) {
< prev index next >