8180821: [macosx]com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java: The menu item should have been GC-ed
Reviewed-by: prr, psadhukhan
--- a/test/jdk/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java Fri Oct 13 08:54:00 2017 -0700
+++ b/test/jdk/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java Mon Oct 16 08:06:56 2017 -0700
@@ -24,7 +24,7 @@
/**
* @test
* @key headful
- * @bug 8158325
+ * @bug 8158325 8180821
* @summary Memory leak in com.apple.laf.ScreenMenu: removed JMenuItems are still referenced
* @requires (os.family == "mac")
* @run main/timeout=300/othervm -Xmx16m ScreenMenuMemoryLeakTest
@@ -67,6 +67,7 @@
});
System.gc();
System.runFinalization();
+ Thread.sleep(1000);
JMenuItem menuItem = sMenuItem.get();
EventQueue.invokeAndWait(new Runnable() {
@Override