Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JInternalFrame is closed, but stay in the memory

 
Nagy Gabor
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vinicius Souza
Ranch Hand
Posts: 70
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was with the same problem here and solved it using this code on the internalFrameClosed event:

Best regards.
 
bhim Nagarhalli
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


try this code. :-)
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic