<AWT Dev> Best workaround for OSX Window leak? (JDK-8029147)

Andy Lee andy.ja.lee at gmail.com
Mon Sep 19 14:19:03 UTC 2016


Not sure if this is the best place to ask, but I'm looking for good way to
prevent the JFrame/JDialog memory leaks caused by
https://bugs.openjdk.java.net/browse/JDK-8029147

The best solution I've found so far is to use reflection to dig in and null
out the 'target' fields on the LWComponentPeer and CPlatformWindow after
disposing.  This at least allows the JDialog/JFrame instance to be GC'd
(along with any heavier objects they may reference), but isn't optimal
since ultimately the LWComponentPeer and CPlatformWindow instances still
end up leaking.  Another problem with this approach is that we have
hundreds of uses of JFrames/JDialogs across our codebase and this
workaround would require each one of them to be modified to add this
special cleanup logic; I'd like to avoid that if at all possible~

Any suggestions?

~Andy Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160919/bb623d1e/attachment.html>


More information about the awt-dev mailing list