changeset 9906:534c50395957 jdk-9+104

Merge
author lana
date Thu, 28 Jan 2016 15:42:23 -0800
parents 02a0ad1ab354 (current diff) 2725fdfbc8e5 (diff)
children f4040e0ac7b1 1edcfb47e131
files
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/gc/metaspace/TestPerfCountersAndMemoryPools.java	Thu Jan 28 09:43:01 2016 -0800
+++ b/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());
     }