jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Memory Leak. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Memory Leak." Watch "Memory Leak." New topic

Memory Leak.

Pete Dawson

Joined: Oct 27, 2009
Posts: 7

I've been experimenting with using two instances of a frame in a Swing Application framework application. I'm trying to use a util.Timer to create a frame then hide it, null the reference and recreate another instance.

When I leave this running I eventually run out of heap?? Can anyone explain why as I think that I am only ever using one one reference to an object on the heap.

TimerTestView is just the plain default view created by the framework.

I have put the timer code in the startup() method as follows:

Darryl Burke

Joined: May 03, 2008
Posts: 5115

MAy or may not be the root cause, but all Swing components should be constructed and mutated on the EDT. There's at least one recorded case where failure to do so resulted in OOME.

edit Another relevant discussion:

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link: http://aspose.com/file-tools
subject: Memory Leak.
It's not a secret anymore!