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 › Remove an image from memory
Page Index Toggle Pages: 1
Remove an image from memory? (Read 388 times)
Remove an image from memory?
Dec 29th, 2006, 1:08am
 
Hi,
I was just wondering if it is possible to remove image data from memory to load up new data and hence not run out of resources.
Thanks

Andy
Re: Remove an image from memory?
Reply #1 - Dec 29th, 2006, 2:14am
 
myImage = null;

Assigning stuff to a value of null generally frees up memory. Java's garbage collector should clean it up for you behind the scenes.

You can call System.gc(); to give the garbage collector a kick up the bum, but it's not guaranteed to happen immediately.
Page Index Toggle Pages: 1