aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JInternalFrame is closed, but stay in the memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalFrame is closed, but stay in the memory" Watch "JInternalFrame is closed, but stay in the memory" New topic
Author

JInternalFrame is closed, but stay in the memory

Nagy Gabor
Greenhorn

Joined: Oct 20, 2003
Posts: 1
Hi,
I have problem with using of JInternalFrame.
I create a new internal frame, and close it."setClosed(true);dispose();"
The frame does not release the memory (after gc the allocated memory is the same)
Before close I removed all listeners, and closed all reference to other object. (I think so :-) )
Do You have any idees?
regards
G´┐Żbor
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I tested this out and it looks like if you ever use JInternalFrame, one reference hangs around forever... I'm trying to trace where this reference is saved, but not having much luck. However, this shouldn't lead to a memory leak because if you launch two or three internal frames and close them all you won't have two or three references hanging around, only one.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Vinicius Souza
Ranch Hand

Joined: May 18, 2011
Posts: 45

I was with the same problem here and solved it using this code on the internalFrameClosed event:

Best regards.


Java is the best (I love C too) heehhh
bhim Nagarhalli
Greenhorn

Joined: Feb 03, 2013
Posts: 1


try this code. :-)
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4543
    
    5

bhim Nagarhalli wrote:

try this code. :-)


First of all, this thread is way past its 'best by' date. Additionally, your code cannot compile, and since a Container cannot be added to itself, would never remove anything even if the typo is ignored.


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: JInternalFrame is closed, but stay in the memory