php memory_limit

Permalink 1 user found helpful
I have a small site setup on a shared hosting environment. My client has been happily editing away until today. When trying to even view the site, the following error showed up:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 122880 bytes) in /.../www/concrete/models/page.php on line 1284

I have to say I was a little shocked. There really isn't that much content and I haven't installed any packages.

The first thing I did was ssh into the machine and nuke the cache. No change. Nothing of use in the error_log. Hmm. I then quickly checked my phpinfo() output and saw that my shared host does, in fact, default the memory_limit to 8M. So, I threw this line into my config/site.php:

ini_set('memory_limit', '16M');

The error was gone. I guess my question is, what are all of you using for your memory_limit for concrete5 installs? What effects memory most in concrete5 (more files, pages, images, etc)? I'm also more than a little confused how adding things to other parts of a site can effect the memory usage for the home page.

everydaycoder
 
hursey013 replied on at Permalink Reply
hursey013
Did you by chance run any of the jobs in the concrete5 dashboard prior to receiving the error? That is the only time I've gotten an out of memory message, and the only way to get rid of it was increasing the memory the same what you did in the php.ini. That only happened on a large site though, 500+ pages, I never had that happen on a smaller site.
everydaycoder replied on at Permalink Reply
everydaycoder
I have a cron job setup to run, so it's entirely possible that one just ran. What memory_limit do you use for your smaller sites?
nteaviation replied on at Permalink Best Answer Reply
nteaviation
I set mine to 16M or 32M (on production)and even as high as -1 (no limit) on internal web servers. Photo galleries tend to need alot of memory.

Most times it is easier to set that value in your php.ini or .htaccess file

.htaccess:
php_value memory_limit 16M

php.ini (on some IIs servers I believe it's php5.ini)
memory_limit = 16M
everydaycoder replied on at Permalink Reply
everydaycoder
Roger that. My host has a few hoops to jump through to customize the php.ini, but I recognize that it is better to change the limit there. This site has no photo album packages installed, but there are almost 40 files that have been uploaded. Not all are actually referenced.