hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java
changeset 37244 9b8f2dc281ad
parent 30604 b8d532cb6420
child 37267 ad8c0e8de29f
--- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java	Mon Apr 04 11:32:04 2016 +0200
+++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java	Thu Mar 24 10:49:08 2016 +0100
@@ -84,6 +84,9 @@
     }
 
     private static void checkUsedIncreasesWhenLoadingClass(String ns) throws Exception {
+        // Need to ensure that used is up to date and that all unreachable
+        // classes are unloaded before doing this check.
+        System.gc();
         long before = getUsed(ns);
         fooClass = compileAndLoad("Foo", "public class Foo { }");
         System.gc();