troubleshooting Question

Memory leak by "fat" JDialogs?

Avatar of sciuriware
sciuriware asked on
46 Comments1 Solution519 ViewsLast Modified:
I got some applications that launch a dialog for reporting purposes.
In there I load some large pictures and/or create some large arrays.
I noticed that every time I do so my memory usage grows by some Mb's,
finally pushing me out.

I tried .dispose(); but that doesn't help.


public class Xdialog extends JDialog
/// builds a heavy GUI,
/// has a button OK,
/// NO setVisible.

public void display()
     setVisible();  // Here the Launcher switches it on.


Xdialog x = new Xdialog(..........................);
     x.dispose();     // Does not release the memory used.

     x = null;           // Same ...

What did I do wrong?


       JDialog xyz = new
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 46 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 46 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros