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 & HelpPrograms › Out of memory loading images
Page Index Toggle Pages: 1
Out of memory loading images (Read 579 times)
Out of memory loading images
Jul 12th, 2006, 10:36pm
 
Hi,

I have a sketch which kind of constantly dissolves between 10 layers of images using transparency. This is implemented using an array of 10 images into which I load 10 bmp files. Each layer stays active for a random amount of time. Once that time runs out a new image is loaded into that layer.

So, a maximum of 10 images are loaded at a given time. I don't unload the images explicitly because I'm counting on garbage collection. But what happens is that, memory used keeps increasing and, after some time, the thing runs out of memory.

Although it is not working as an applet, I published it to the following url so that the code could be available:

http://nunogodinho.com/processing/barbara20060712

Do I need to explicitly unload the image somehow? What am I doing wrong?

Thanks in advance,
Nuno
Re: Out of memory loading images
Reply #1 - Jul 27th, 2006, 4:48am
 
can you post an example of what's in the xml files the code references? Thanks....
Re: Out of memory loading images
Reply #2 - Jul 27th, 2006, 11:07pm
 
Here's an example of the XML file:

<?xml version="1.0"?>
<images>
 <image x="453.75" status="3" name="0576" s="56.75" r="-0.5" y="289.25"/>
 <image x="379.25" status="3" name="0577" s="62.75" r="-8.5" y="308.0"/>
 <image x="455.25" status="3" name="0438" s="58.0" r="0.25" y="306.5"/>
 <image x="478.0" status="3" name="0136" s="55.0" r="-2.0" y="312.0"/>
</images>
Page Index Toggle Pages: 1