File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Memory Leak." Watch "Memory Leak." New topic
Author

Memory Leak.

Pete Dawson
Greenhorn

Joined: Oct 27, 2009
Posts: 7
Hi,

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:



Thanks
Pete
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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.
http://forums.sun.com/thread.jspa?threadID=5406558

edit Another relevant discussion:
http://forums.sun.com/thread.jspa?threadID=5279223


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.
 
Similar Threads
Timer starts twice when it should start only once
EJB Timer Services Query
Stuck on setVisible()
How do I refresh the system time
Timer starts twice when it should start only once