test/java/lang/annotation/loaderLeak/Main.java

Print this page

        

@@ -55,12 +55,17 @@
         System.gc();
         if (c.get() == null) throw new AssertionError();
         System.gc();
         System.gc();
         loader = null;
+        while(true) {
         System.gc();
-        System.gc();
+            Thread.sleep(20);
+            if(c.get() == null) {
+                break;
+            }
+        }
         if (c.get() != null) throw new AssertionError();
     }
 }
 
 class SimpleClassLoader extends ClassLoader {