i've been attempting to reduce memory consumption on my app too.

use debug($this) to see the different objects loaded into memory, and make
sure to pass by reference where possible.

i also added this snippet at the bottom of my default.ctp:

echo '<u>Memory Usage:</u><br />';
$memory_in_bytes = memory_get_peak_usage();
echo '_B: '.$memory_in_bytes.'<br />';
echo 'KB: '.round($memory_in_bytes/1024,1).'<br />';
echo 'MB: '.round($memory_in_bytes/1024/1024,1).'<br />';

by reducing recursion and turning off some helpers and i can't remember what
else, i managed to reduce memory use by about 0.6mb, but so far no more than
that.

~Kirk

On Tue, Jul 13, 2010 at 8:02 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> I'd also check your model associations and controller code to check that
> you are not in a recursive loop, retrieving too much data or have some other
> gotcha. IMO, I think it's better to get to and fix the root cause rather
> than just paper over it. If your memory is really being stretched, then you
> will not have optimum performance.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 13 Jul 2010, at 12:58, Ayman Bedair wrote:
>
> > This happened with me on the local windows server while testing,
> > didn't really see the problem up on my live one.
> >
> > Anyway if u have access to the PHP.INI file you can just go there and
> > edit the "memory_limit = 16M" value to something like "memory_limit =
> > 50M". I had this set to 150MB and it didn't affect the computer
> > stability so go up until it's sufficient for you app to run. (You need
> > to restart your server after changing this value for the new settings
> > to take effect)
> >
> > If this is not a convenient solution try setting the debug to 0 and
> > the  "var $persistModel = false;" in your controllers. That should
> > save up some of the memory space I believe.
> >
> > Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
> >  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to