• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Memory Errors and Swing/AWT

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It's a tiny ad only because the water is so cold.
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic