• Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory Cleanup  RSS feed

 
Kenneth Winn
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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!
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • 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
  • 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.


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!