Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a server that's handling uploads. The memory limit is set at a ridiculously high level in php.ini (800 M).. however we have gd, which is managing the image resizing, but it is dying at about 60M of memory usage (our error log is reporting a fatal error at this stage).

From all our Apache config files (CPanel/WHM managed), I can't find a RLimitMem that's set anywhere either.

I've looked as well if there's any limits set in our kernel, but can't find anything there as well.

Is there something I might be missing?

* Log detail*

09-Nov-2011 09:41:26] PHP Fatal error: Out of memory (allocated 60030976) (tried to allocate 18000 bytes) in |pathremovedForSecurity|.php on line 60

I know that it's where GD calls createimagefromjpeg();, the issue is that the limit that it is dying at is way below what our actual server limit is.

share|improve this question
    
Post the fatal error message from your logs -- that might make it easier for someone to answer your question. –  KM. Nov 9 '11 at 20:16
    
09-Nov-2011 09:41:26] PHP Fatal error: Out of memory (allocated 60030976) (tried to allocate 18000 bytes) in <pathremovedForSecurity>.php on line 60 I know that it's where GD calls createimagefromjpeg();, the issue is that the limit that it is dying at is waaay below what our actual server limit is. –  Dustin Dawes Nov 9 '11 at 20:25
    
How does gd handle files smaller than 60 MB? What do you see in top in terms of memory and CPU usage during an upload that fails? How much RAM do you have, btw, on the box? –  KM. Nov 9 '11 at 20:54
    
We have 8 GB of RAM. It's not the file size that is causing the issue, more the resolution as GD ends up needing to allocate memory in order to do the resizing functions. Images that don't use up more than 60 MB of RAM (we've found 4000x4000 seems to be the magic number to cause it to fail). GD ends up needing to do image resizing (On a VM I setup for testing.. a 4000x4000 image uses 110MB of RAM) which is where it runs out of memory. –  Dustin Dawes Nov 9 '11 at 20:58
    
Well, this is embarrassing. I've done more trawling through CPanel's config files and they hid the RLimitMEM setting in an obscure place. (/etc/httpd/conf/includes/pre_main_global.conf) I jacked that up and it works again as expected. Sorry for this wasted space thread. –  Dustin Dawes Nov 9 '11 at 22:26
add comment

1 Answer

up vote 1 down vote accepted

Well, this is embarrassing. I've done more trawling through CPanel's config files and they hid the RLimitMEM setting in an obscure place. (/etc/httpd/conf/includes/pre_main_global.conf) I jacked that up and it works again as expected. Sorry for this wasted space thread.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.