Running Out Of Memopry

Has anyone ever seen this error:

Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 88 bytes) in /hsphere/local/home/c75816/ on line 312

View Replies: View Best Answer
Brainakazariua replied on at Permalink Best Answer Reply
Your site is using more memory then allowed on the server.

In your php.ini on the server there is a line stating the memory_limit with a certain amount of M behind it.
Set that to 64M or 128M (or even more) to solve your problem.

Depending on your host it might be that you can set the limit in your .htaccess by using the following:
php_admin_value memory_limit 64M
kellycunningham replied on at Permalink Reply
Thanks for the response. It was obvious from the message that there was a memory issue. However, what I was doing should not have caused anything like this. I remembered on a previous C5 site (2 years ago) that I had caching issues so I turned off the cache and everything works fine. My memory allocation is already set to 256M. I think C5 has issues with how it is doing caching. Generally, websites are relatively small memory hogs and what I was doing in particular was minor. Really should not have run into this problem. I am using a theme that I purchased on C5 that is proven to have not been very well tested so maybe that's an issue but I'm not sure. Like I said, I had this issue before and no matter how much memory was allocated, the caching caused problems. I was hoping in two years things had improved. Everytime I use C5 I run into something that convinces me that it still needs to mature. When it is working as it is suppose to work, I find it hands down the best CMS but these issues are always frustrating. Again, thanks for the response.
frz replied on at Permalink Reply
If you believe caching is at fault, try turning it off.

best wishes

Franz Maruna
kellycunningham replied on at Permalink Reply
That's what I did and everything worked. I had a cache issue previously with C5 as well where I knew there were no memory allocations issue on my end. Turning off the cache doesn't seem the best long term solution in terms of performance... I think fixing C5 would be a better answer.
mesuva replied on at Permalink Reply
25165824 bytes is exactly 24MB.

So I'd suggest that your PHP memory limit is still stuck at that limit, even though you've tried to set it to 256. Some hosts don't allow you to override that value or at least you have to ask them to change it. I'd confirm your memory limit with a phpinfo file.
kellycunningham replied on at Permalink Reply
Nope. I worked with the host on this issue for another site and I know the limit. As I said (not sure if you saw the post) I turned off the cache and everything worked and I've experienced cache issues with C5 before. On the previous one it was an in-house web server and the memory allocation was even higher. Caching on C5 has some serious issues -- no matter the memory allocation.
mesuva replied on at Permalink Reply
If you turn off the cache and then it starts working again, it doesn't necessarily mean the cache is at fault - the cache is going to use memory and that's probably the thing that is pushing you over the memory limit.

I've personally never seen PHP throw a fatal error about running out of memory that wasn't caused by not having enough memory. There's a chance that the caching in concrete5 is using too much memory, but again your error message is saying 24MB.

Show us a screenshot of your php info file with the memory limit.
kellycunningham replied on at Permalink Reply
I'm sure the error message means what it says so I don't understand the point of your reply. My point is there is no way that it should be running out of memory just because caching is on. As I said, I've run into this caching issue with C5 previously where we had complete control of memory allocation and it still gave us problems. I've moved on with this. I simply know I need to step gingerly around caching in C5. Thanks for the reply.
mesuva replied on at Permalink Reply 1 Attachment
I'll phrase it another way:

PHP is only going to output that kind of fatal error if PHP has, in fact, run out of memory. Those error messages also report the memory you had available, in your case 24M (1024 * 1024 * 24). Therefore, from the error message itself you can tell that PHP thinks its memory_limit is 24MB and it's stopping at that value.

That's why I said to take a screenshot of your phpinfo, showing what PHP is reporting. Perhaps you've set a higher memory limit, but it's not actually taking effect. Some hosts allow you to override the setting, some don't.

As a quick experiment, I turned the cache on for a site and started to wind back my memory limit. At 32M, no probs at all. At 24M, I still didn't have a problem (but my test site is effectively empty). At 18M, concrete5 would fatal error because of memory, with the same error message as yours, see attached screenshot. If I then repeated this, but with caching off, the site would still work at 18M, but that's because I'm skirting around the lower limits of what the site needs, and caching obviously has memory overhead. This behaviour is all expected.

So what I'm politely suggesting here is that I think you're jumping to the wrong conclusion that concrete5 has a caching bug that is causing your error.
alxbob8 replied on at Permalink Reply
Hi there,
I have the same error !! But strange enough only with uploading a JPG file (0,8Mb) and not wit a PDF file (1,2 Mb)

This is the error message:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 37223953 bytes)

anybody here an idea ??
Gondwana replied on at Permalink Reply
It's possible that c5 'opens' image files on upload in order to create thumbnails, etc. This could involve uncompressing the file to get an RGB array, which would take much more space than the compressed file.

Can the poster-quality file be uploaded and handled as a generic file, rather than an image per se? Let people download it by clicking on a link. You can upload a smaller version for display on your site.
alxbob8 replied on at Permalink Reply
Yes, that could be an option, that I use a thumbnail for the website and make a zip for the poster.

For this moment I do it like this, not the most elegant way, because I can't see anymore which poster it is. But for the functionality it is working.

look at the bottom of the block and you will see a poster zipped