[Rev 01] RFR: 8241840: Memoryleak: Closed focused Stages are not collected with Monocle.
Florian Kirmaier
fkirmaier at openjdk.java.net
Wed Apr 22 10:55:29 UTC 2020
On Thu, 16 Apr 2020 18:56:21 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
>> This version doesn't work for me.
>> With this change, I get the following error:
>> test.javafx.stage.FocusedWindowTest > testLeak FAILED
>> junit.framework.AssertionFailedError: Exceeded timeout limit of 10000 msec
>> at test.util.Util.runAndWait(Util.java:163)
>> at test.util.Util.runAndWait(Util.java:134)
>> at test.javafx.stage.FocusedWindowTest.testLeak(FocusedWindowTest.java:82)
>
> This is happening because after the last stage is closed JavaFX runtime shuts down implicitly unless specified
> otherwise using `Platform.setImplicitExit(false);`. So `initFX()` should look as,
> ```
> @BeforeClass
> public static void initFX() throws Exception {
> startupLatch = new CountDownLatch(1);
> Platform.startup(startupLatch::countDown);
> Platform.setImplicitExit(false);
> Assert.assertTrue("Timeout waiting for FX runtime to start",
> startupLatch.await(15, TimeUnit.MILLISECONDS));
> }
It works now, great!
-------------
PR: https://git.openjdk.java.net/jfx/pull/153
More information about the openjfx-dev
mailing list