8148483: JEP 280: Indify String Concatenation
authorshade
Thu, 28 Jan 2016 19:43:18 +0300
changeset 35373 51858d53abfb
parent 35361 4a652e4ca952
child 35374 ee75f02947c2
8148483: JEP 280: Indify String Concatenation Reviewed-by: psandoz, mcimadamore, igerasim, forax, plevart, vlivanov, ihse Contributed-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>, Remi Forax <forax@univ-mlv.fr>, Peter Levart <peter.levart@gmail.com>
hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java
--- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java	Wed Jul 05 21:15:54 2017 +0200
+++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java	Thu Jan 28 19:43:18 2016 +0300
@@ -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());
     }