<Swing Dev> [11] Review Request: 8202878 com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java fails

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Fri May 11 01:42:54 UTC 2018


Hello.
Please review the fix for jdk11.

Bug: https://bugs.openjdk.java.net/browse/JDK-8202878
Fix: http://cr.openjdk.java.net/~serb/8202878/webrev.00

The test tries to check that the JMenuItem will be collected by GC if it 
was removed from the menu. The problem is that the code below does not 
guarantied that gc will happen:

68         System.gc();
69         System.runFinalization();
70         Thread.sleep(1000);

In the fix it is replaced by the code which will generate OOM, to be 
sure that gc will happen.

-- 
Best regards, Sergey.



More information about the swing-dev mailing list