• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Memory Cleanup

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been using JProbe to clean up memory in an applet. I was
able to eliminate all references that other objects had to the
applet from custom classes. After reloading the applet (stop,
destroy, init and start get run) the previous instance of the main applet class is still in memory along with the new instance. I have even gone as far as commenting out the guts of the init, start, stop and destroy so that the applet does not
create any new objects and I am still left with the previous instance of the applet object.
The biggest culprit (memory) is an int[] that takes up about 1MB of memory. Are there any other cleanup calls that I should make on the JApplet class to eliminate this previous instances of my
applet class that extend JApplet? I was expecting my memory to all be returned once the applet was destroyed. Thanks!
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about setting your array reference to null and a call to System.gc() just before closing ?? I am not 100% if this would do the trick, but I think its worth trying.

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.
 
Kenneth Winn
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ajith Kallambella:
How about setting your array reference to null and a call to System.gc() just before closing ?? I am not 100% if this would do the trick, but I think its worth trying.
Thanks for the input. I do not have a reference to the int[]. It was created by the system. it is owned by DataBufferInt and it's parent is IntegerInterleavedRaster. I am not familiar with these. Somewhat system created them.


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic