8148483: JEP 280: Indify String Concatenation

Co-authored-by: Remi Forax <forax@univ-mlv.fr>
Co-authored-by: Peter Levart <peter.levart@gmail.com>
Reviewed-by: psandoz, mcimadamore, igerasim, forax, plevart, vlivanov, ihse
This commit is contained in:
Aleksey Shipilev 2016-01-28 19:43:18 +03:00
parent 8521982b8d
commit 121083c09e

View File

@ -64,14 +64,18 @@ public class TestPerfCountersAndMemoryPools {
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());
}