# HG changeset patch # User lana # Date 1454024543 28800 # Node ID ee75f02947c22b9cedbb4dbff3c3daf8a13ab835 # Parent 85829416d15378a2b040a04403d7d7fefb7b7102# Parent 51858d53abfb9f81d8a6aacd3d071d1ab76609d5 Merge diff -r 85829416d153 -r ee75f02947c2 hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java --- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java Thu Jan 28 09:43:01 2016 -0800 +++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java Thu Jan 28 15:42:23 2016 -0800 @@ -64,14 +64,18 @@ throws Exception { MemoryPoolMXBean pool = getMemoryPool(memoryPoolName); + // First, call all the methods to let them allocate their own slab of metadata + getMinCapacity(perfNS); + getCapacity(perfNS); + getUsed(perfNS); + pool.getUsage().getInit(); + pool.getUsage().getUsed(); + pool.getUsage().getCommitted(); + assertEQ(1L, 1L); + // Must do a GC to update performance counters System.gc(); assertEQ(getMinCapacity(perfNS), pool.getUsage().getInit()); - - // Must do a second GC to update the perfomance counters again, since - // the call pool.getUsage().getInit() could have allocated some - // metadata. - System.gc(); assertEQ(getUsed(perfNS), pool.getUsage().getUsed()); assertEQ(getCapacity(perfNS), pool.getUsage().getCommitted()); }