tags:

views:

26

answers:

1

I have a site using cakephp1.2.8 running on a ubuntu9.04 server. It works fine with 16M memory_limit. Now I moved the site to a new CentOS5.5 VPS. Then the server starts to show errors like this:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 342095888 bytes) in Unknown on line 0

It displays pages correctly, but shows this error at the bottom. The number of bytes it tried to allocate is random. Did I miss something?

A: 

Is the new server 64bit? Does the new server have any more apache/php modules that the other?

CakePHP is fat... we have ours set to 90~MB

You can always go through your index/dispatcher/controllers and debug with the memory usage and dumps.

Also does the new VPS DB have more data? You could be pulling in to many objects with your finds, you might want to limit the query/recursiveness.

Hope it helps

Wizzard
Thanks for your hints. Cakephp is fat, but 256M sounds hard to believe. This problem only happens when there are some db queries. It works on another host with 16M and exactly same data.
Purui
When I quick looked I thought it was 26/34Mb. I would step through and look at some debug memory output, and also check db queries.
Wizzard
I hope I helped :) I would also have a look at the app with xdebug. I wonder though if you got some queries which are trying to query all databases on the server, or tables? Or do you have some logging table which has gotten big now? I would; * Turn on Debug Level 2 and check all queries. * Turn off debug and run through with xdebug.
Wizzard