We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › garbage collection
Page Index Toggle Pages: 1
garbage collection (Read 659 times)
garbage collection
Feb 13th, 2008, 3:50pm
 
I know Java should clean up itself but I was wondering if there was a way to force garbage collection and free up memory.

I have an applet that renders images. The first renders fine, but after a few renders it will slow down considerabily. Even though the large objects (that might cause it) are overwritten for each new render (I also checked for any other references but there aren't any), and so memory should be cleaned up.

Reloading Firefox doesn't help, I have to quit it and restart before I get the normal framerate back.
Re: garbage collection
Reply #1 - Feb 13th, 2008, 5:35pm
 
You can force garbage collection with:

System.gc();

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#gc()
Re: garbage collection
Reply #2 - Feb 13th, 2008, 6:20pm
 
ah ok...
thanks...
(love your moviemaker btw)
Page Index Toggle Pages: 1