Hi,

I have installed imagecache 2 with the imageapi. I'm having memory limit problems

At 32M some images ar not getting generated for example those of 2048px × 1536px .
At 64M those get generated.

And then at 64MB I am not able to add all images to a node. I am not sure what size the images are.

I see that imageapi requires 96MB, so I guess this is my fault for not reading up on this.

So the main question for me is: Is a downgrade to imagecache 5.1 likely to circumvent these problems so that 32M on the server would serve me better?

And out of curiosity would pushing the php memory limit up to 96MB have serious consequences for other users of the shared server, given that uploading of mew images is just going to be happening occasionally i.e this is not a social networking site with users uploading images?

Thanks in advance,
arcX

Comments

liquidcms’s picture

Title: Question about php memory limiits and different versions handling of it » Imagecache won't work in smaller memory environments.
Component: Miscellaneous » Code
Category: support » feature
Priority: Normal » Critical

changed title

I am also having memory issues with imagecache (using 2.0). We are just switching over a very large, very high performance site (consumersearch.com) to Drupal. Although the site runs on many servers, Apache may have many instances running to handle the load. Proving 96M is not feasible for us - plus even at 96M it doesn't work:

Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 4 bytes) in /mnt/cs/www/stage.consumersearch.com/includes/database.mysql.inc on line
188

I think the only mem issue would be creating mutliple new images on a page as opposed to viewing that page after miages have been created. Is it possible to have some cron task go through the site and pre-create all the images. Although iguess that process would still need more memory.

liquidcms’s picture

ok, i am renegging on original comments... i am not sure it was icache causing the mem overlaod..

alexiscott’s picture

I ended up using .htaccess to further increase the PHP memory_limit to 96MB, and I tested and found that I was able to upload even high res images - Up to 6MB. However being a shared server I am still concerned that this might not be sufficient, given that, and I could be wrong, if the the server is very busy then other sites on the same server could have an impact. I say this because uploading the same images at lower memory limits was occasionally working, and the time of day seemed to be the only differential.

I am still curious if a downgrade would make the difference, and if it would be easy to implement, I.e. the nodes would not lose data? However for the time being I am just touching wood that this has fixed the original problem/s for good.

The Cronjob suggestion also sounded interesting - maybe given that It could be run at a time when the server is least busy.

aries’s picture

Maybe, the problem is that you use too large pictures. By the filesize, I assume that you're using 12Mpx images, and because of the RGBA only one image eats at least 48Mbyte memory. So keep in mind, the filesize is compressed, the image manipulation application have to decompress it to work - into the memory.

alexiscott’s picture

Status: Active » Closed (won't fix)

Upgrading to 96MB on my host did seem to be the only fix possible. A downgrade to an earlier version of imagecache might have helped but I like to keep up to date with what's going on.

Also I think that a big part of my problem was in Imagefileld's handling of images on the node edit page - so not imagecache. That is downloading the full size images. Later versions of imagefield use a scaled image, and this makes a huge difference on those pages.