Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory Errors and Swing/AWT  RSS feed

 
Micah Wedemeyer
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make sure that my unused Components are being destroyed by the garbage collector? I keep getting an out of memory error after I make a few panels containing a large image. Each time, I overwrite the old panel with the new image. However, I suspect that the old panels are not being garbage collected due to some sort of reference being held by the windowing system.
Any advice?
 
Frank Hale
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much memory do you have?
Garbage Collection cannot be forced.
 
Micah Wedemeyer
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 256mb of physical ram and a pagefile size of 512.
If I call the JVM with the parameters:
-mx128m -ms128m
then it runs a little more before crashing out, so I know it is a memory leak in there somewhere.
I'm pretty sure it has to do with the creation and destruction of windows.
Micah
 
Frank Hale
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your code so I can try to duplicate your error?
 
Micah Wedemeyer
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really. It's long, complicated, and involves input files.
It is not too important since I am not using it for anything long term. I can generate the images one-by-one, then save them to disk for viewing. I just wanted to be able to do it all at once.
Thanks for trying.
Sigh...
Micah
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!