Loading...
Logo
Processing Forum

Memory issues, increase memory.

in General Discussion  •  Other  •  9 months ago  
Hi,

I know this issue has been discussed a few times already. And I've seen the existing posts but none of them has a definitive answer for my issue. So again I will ask hoping that you guys can help me.

I've been working for some time on a Processing prject, and everything works perfectly. Except for the consumption of the memory, the program needs to load a lot of images thus using a lot of memory. I've set the memory in the preferences to the maximum setting possible on my computer which is 1600mb (1024mb if exported). I have a PC running on Win7 64 with 8GB of ram, a i7 processor and a good 2GB AMD graphics card).

What I would like to know, is if there is any way to increase the memory preferences way up 1600mb ?

Thanks in advance for any advice. 


Replies(4)

Perhaps you should load less images into memory.
Let's say you have 1000 images total.
Rather than committing all of them at once, you could instead have an array for 100 images (10% of total).
Then, loading only 100 images to memory; which are gonna be cached for fast access!
Later, if you need access to the others, you can replace some of current 100 images to new loaded ones.
This way, you keep a low current memory profile, since Java's garbage collector automatically removes any object that it's not being used anymore!
Fisrt of all, thanks for your reply. Sadly i've already used all the means possible (in my knowledge) to use the least possbile amount of memory, loading only the needed images et erasing the unused ones. Still the program needs to load a hell of a lot of images (I realized now Processing may not be the best program for that). That's why I'm wondering if there anyway to icrease the memory settings past the limit of 1600mb ?
Use a 64-bit version of Java to be able to allocate more memory.
Just updated to the last version of processing , which uses the 64bit version of java and everything works perfectly, thanks a lot Philho. Just one problem though, my code works perfectly fine (except for the memory issue) on the 1.5.1 version, but the v2 of processing tells me there are "one too many { characters without a } to match it"...There isn't. If there was the error would also show on the older version I think. I can't seem to find where the error lies.

Is there any way to use the older version with the 64-bit version of the java JDK (I tried downloading the version without java but It tells me that it needs a JDK, which is already installed on my computer).

Edit : Never mind just did, thanks for the advice GoToLoop and especially PhiLho, you were both very helpful. I still can't believe it was that easy. Just installed the 64bit version of java made a few changes to the Processing file and voilà, I can now use more than enough memory for my program. Again thanks a lot.