Re: Fatal memory allocation error at cleanup on production server only

2010-03-14 Thread Mark Hindley
OK, I have tracked down a minimal test case and it seems to be nothing to
do with CakePHP. So sorry for the noise.

Just FYI, the following minimal php script produces the Fatal error,
even outside CakePHP, so it seems to be something in the php
installation.



Thanks for your help

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread nurvzy
You can try narrowing it down by lopping off sections of your app one
a time.  Start with broad strokes, rename your database.php file to
something else taking away the database connection all together. Your
app will fail but it might give you a place to start if you don't run
into the out of memory error.  From there dig into the dbo_mysql.php
or any custom datasource you might be using.

Good luck.

On Mar 13, 6:15 am, Jon Bennett  wrote:
> >> Could it be traffic specific? Do your dev boxes have cpanel on them or
> >> are they identical?
>
> > Possibly. The dev boxes are just various versions of Debian. I think trying 
> > to
> > reproduce the exact versions of everything on the cpanel box will be
> > tricky. And if it is a configuration issue, it still may not trigger the
> > error.
>
> profiling with xdebug is the only option i think, fingers crossed the
> host lets you do it (otherwise, perhaps strip off cpanel so you can).
>
> j
>
> --
> jon bennett -www.jben.net- blog.jben.net

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Jon Bennett
>> Could it be traffic specific? Do your dev boxes have cpanel on them or
>> are they identical?
>
> Possibly. The dev boxes are just various versions of Debian. I think trying to
> reproduce the exact versions of everything on the cpanel box will be
> tricky. And if it is a configuration issue, it still may not trigger the
> error.

profiling with xdebug is the only option i think, fingers crossed the
host lets you do it (otherwise, perhaps strip off cpanel so you can).

j

-- 
jon bennett - www.jben.net - blog.jben.net

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Mark Hindley
On Sat, Mar 13, 2010 at 12:56:56PM +, Jon Bennett wrote:
> > Possibly -- but that is part of the problem. I identical cakephp and app
> > running of 2 dev systems and it runs flawlessly with no equivalent
> > error.  It only seems to be happening on this particular system,
> > unfortunately that is the production server!
> 
> Could it be traffic specific? Do your dev boxes have cpanel on them or
> are they identical?

Possibly. The dev boxes are just various versions of Debian. I think trying to
reproduce the exact versions of everything on the cpanel box will be
tricky. And if it is a configuration issue, it still may not trigger the
error.

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Jon Bennett
> Possibly -- but that is part of the problem. I identical cakephp and app
> running of 2 dev systems and it runs flawlessly with no equivalent
> error.  It only seems to be happening on this particular system,
> unfortunately that is the production server!

Could it be traffic specific? Do your dev boxes have cpanel on them or
are they identical?


-- 
jon bennett - www.jben.net - blog.jben.net

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Mark Hindley
On Sat, Mar 13, 2010 at 12:30:39PM +, Jon Bennett wrote:
> >> can you install xdebug? http://xdebug.org/
> >
> > The production server is on cpanel so I don't think I can directly. I
> > have just asked the hosting provider to consider it.
> 
> Is it feasible to purchase another box without cpanel but the same
> spec that you can put xdebug on, perhaps routing some traffic to one
> and some to the other to test?

Possibly -- but that is part of the problem. I identical cakephp and app
running of 2 dev systems and it runs flawlessly with no equivalent
error.  It only seems to be happening on this particular system,
unfortunately that is the production server!

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Jon Bennett
>> can you install xdebug? http://xdebug.org/
>
> The production server is on cpanel so I don't think I can directly. I
> have just asked the hosting provider to consider it.

Is it feasible to purchase another box without cpanel but the same
spec that you can put xdebug on, perhaps routing some traffic to one
and some to the other to test?

j

-- 
jon bennett - www.jben.net - blog.jben.net

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Jon Bennett
>> can you install xdebug? http://xdebug.org/
>
> The production server is on cpanel so I don't think I can directly. I
> have just asked the hosting provider to consider it.

Ahh, another case of cpanel/plesk et all getting in the way - good luck.

j

-- 
jon bennett - www.jben.net - blog.jben.net

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Mark Hindley
On Sat, Mar 13, 2010 at 11:53:58AM +, Jon Bennett wrote:
> can you install xdebug? http://xdebug.org/

The production server is on cpanel so I don't think I can directly. I
have just asked the hosting provider to consider it.

Cheers,

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Jon Bennett
can you install xdebug? http://xdebug.org/

j

On 13 March 2010 11:13, Mark Hindley  wrote:
> On Fri, Mar 12, 2010 at 09:24:06PM -0800, Dr. Loboto wrote:
>> Did you place echos in each deatructor both on enter and exit?
>
> Yes. The one in socket.php didn't seem to be being called, but the
> others all seemed to run and exited before the Fatal error appears.
>
> Are the destructors the very last thing that CakePHP runs? Does that
> imply that the error comes from somewhere else in the php installation?
> Other php scripts on the server run without causing the error, so it
> appears to be something that CakePHP is doing. If I am to persuade the
> hosting admin that is is something in the php installation, I will need
> to be able to produce a short test case that reproduces it.
>
> Mark
>
> 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
>



-- 
jon bennett - www.jben.net - blog.jben.net

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-13 Thread Mark Hindley
On Fri, Mar 12, 2010 at 09:24:06PM -0800, Dr. Loboto wrote:
> Did you place echos in each deatructor both on enter and exit?

Yes. The one in socket.php didn't seem to be being called, but the
others all seemed to run and exited before the Fatal error appears. 

Are the destructors the very last thing that CakePHP runs? Does that
imply that the error comes from somewhere else in the php installation?
Other php scripts on the server run without causing the error, so it
appears to be something that CakePHP is doing. If I am to persuade the
hosting admin that is is something in the php installation, I will need
to be able to produce a short test case that reproduces it.

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Dr. Loboto
Did you place echos in each deatructor both on enter and exit?

On Mar 13, 2:59 am, Mark Hindley  wrote:
> On Fri, Mar 12, 2010 at 08:24:33AM -0800, Dr. Loboto wrote:
> > If error occurs on shutdown it definitely caused by some destructor.
> > I've looked into all defined by cake core destructors and found some
> > possible dangerous in some cases. All of them write caches and use
> > array_filter($objects_to_save) that may give memory allocation error
> > if $objects_to_save is a large array and memory is not enough.
> > Configure writes objects map, App writes dirs map and files map and
> > I18n writes domains map.
>
> > Also ConnectionManager closes session. Own session handler code may
> > also have dangerous operations. DataSource closes connecton, custom
> > datasource may have dangerous code.
>
> I have been through all of the destructors and put a debugging echo in
> each one. The Fatal error seems to come after they have all run. Does
> that mean it is coming from outside CakePHP? Other php scripts on the
> server run with no error.
>
> Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Mark Hindley
On Fri, Mar 12, 2010 at 08:24:33AM -0800, Dr. Loboto wrote:
> If error occurs on shutdown it definitely caused by some destructor.
> I've looked into all defined by cake core destructors and found some
> possible dangerous in some cases. All of them write caches and use
> array_filter($objects_to_save) that may give memory allocation error
> if $objects_to_save is a large array and memory is not enough.
> Configure writes objects map, App writes dirs map and files map and
> I18n writes domains map.
> 
> Also ConnectionManager closes session. Own session handler code may
> also have dangerous operations. DataSource closes connecton, custom
> datasource may have dangerous code.

I have been through all of the destructors and put a debugging echo in
each one. The Fatal error seems to come after they have all run. Does
that mean it is coming from outside CakePHP? Other php scripts on the
server run with no error. 

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Dr. Loboto
If error occurs on shutdown it definitely caused by some destructor.
I've looked into all defined by cake core destructors and found some
possible dangerous in some cases. All of them write caches and use
array_filter($objects_to_save) that may give memory allocation error
if $objects_to_save is a large array and memory is not enough.
Configure writes objects map, App writes dirs map and files map and
I18n writes domains map.

Also ConnectionManager closes session. Own session handler code may
also have dangerous operations. DataSource closes connecton, custom
datasource may have dangerous code.

On Mar 12, 3:10 pm, Mark Hindley  wrote:
> On Thu, Mar 11, 2010 at 09:01:26AM -0800, Dr. Loboto wrote:
> > If your production runs with debug = 2 it may be big SQL log and new
> > allocation to show it. But I'm not sure.
>
> Thanks. The production was running with debug = 0. When it is set to 2,
> the Fatal Error appears after the SQL log is output, so it doesn't
> appear to be that.
>
> Any other suggestions of how to get a handle on this?
>
> My understanding is you can't trap Fatal Errors like this to get a
> backtrace. The error message doesn't give a location. I don't even know
> where to start looking!
>
> Cheers,
>
> Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-12 Thread Mark Hindley
On Thu, Mar 11, 2010 at 09:01:26AM -0800, Dr. Loboto wrote:
> If your production runs with debug = 2 it may be big SQL log and new
> allocation to show it. But I'm not sure.

Thanks. The production was running with debug = 0. When it is set to 2,
the Fatal Error appears after the SQL log is output, so it doesn't
appear to be that. 

Any other suggestions of how to get a handle on this?

My understanding is you can't trap Fatal Errors like this to get a
backtrace. The error message doesn't give a location. I don't even know
where to start looking!

Cheers,

Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-11 Thread Dr. Loboto
If your production runs with debug = 2 it may be big SQL log and new
allocation to show it. But I'm not sure.

On Mar 11, 2:55 pm, mark  wrote:
> On 6 Mar, 21:58, mark  wrote:
>
>
>
>
>
> > Hi,
>
> > I have a cakephp app that has started to throw a Fatal Memory
> > allocation error. Strangely it only happens on the production server
> > (Cpanel, php 5.2.12) but not on either dev machines (php 5.2.11). This
> > is with CakePHP version 1.2.4.8284.
>
> > It has only started recently, nothing in the script changed so I
> > suspect it is a change to the hosting server, but I haven't traced it
> > yet.
>
> > The error comes right at the end of the script, after the  so
> > looks like it might be related to cleanup.
> > They all look like this, although some of the numbers change slightly:
>
> >         Fatal error: Allowed memory size of 67108864 bytes exhausted
> > (tried to allocate 432212624 bytes) in Unknown on line 0
>
> > The server has a hard memory_limit of 64MB, so the memory_limit 128MB
> > in app/webroot/test.php is ignored.
>
> > I have no idea how to track this down and would be grateful for some
> > suggestions.
>
> > What I find very strange is that CakePHP should be trying to allocate
> > 432MB as it is cleaning up and closing down. Seems very odd to me.
> > Just increasing memory_limit is not possible (hard limit on server)
> > and cannot be right as that would just cover something that surely
> > shouldn't be happening.
>
> > Thanks for your help
>
> > Mark
>
> No suggestions so far on this. Would more/other information be useful?
>
> Thanks
>
> Mark

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


Re: Fatal memory allocation error at cleanup on production server only

2010-03-11 Thread mark
On 6 Mar, 21:58, mark  wrote:
> Hi,
>
> I have a cakephp app that has started to throw a Fatal Memory
> allocation error. Strangely it only happens on the production server
> (Cpanel, php 5.2.12) but not on either dev machines (php 5.2.11). This
> is with CakePHP version 1.2.4.8284.
>
> It has only started recently, nothing in the script changed so I
> suspect it is a change to the hosting server, but I haven't traced it
> yet.
>
> The error comes right at the end of the script, after the  so
> looks like it might be related to cleanup.
> They all look like this, although some of the numbers change slightly:
>
>         Fatal error: Allowed memory size of 67108864 bytes exhausted
> (tried to allocate 432212624 bytes) in Unknown on line 0
>
> The server has a hard memory_limit of 64MB, so the memory_limit 128MB
> in app/webroot/test.php is ignored.
>
> I have no idea how to track this down and would be grateful for some
> suggestions.
>
> What I find very strange is that CakePHP should be trying to allocate
> 432MB as it is cleaning up and closing down. Seems very odd to me.
> Just increasing memory_limit is not possible (hard limit on server)
> and cannot be right as that would just cover something that surely
> shouldn't be happening.
>
> Thanks for your help
>
> Mark

No suggestions so far on this. Would more/other information be useful?

Thanks

Mark

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


Fatal memory allocation error at cleanup on production server only

2010-03-06 Thread mark
Hi,

I have a cakephp app that has started to throw a Fatal Memory
allocation error. Strangely it only happens on the production server
(Cpanel, php 5.2.12) but not on either dev machines (php 5.2.11). This
is with CakePHP version 1.2.4.8284.

It has only started recently, nothing in the script changed so I
suspect it is a change to the hosting server, but I haven't traced it
yet.

The error comes right at the end of the script, after the  so
looks like it might be related to cleanup.
They all look like this, although some of the numbers change slightly:

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

The server has a hard memory_limit of 64MB, so the memory_limit 128MB
in app/webroot/test.php is ignored.

I have no idea how to track this down and would be grateful for some
suggestions.

What I find very strange is that CakePHP should be trying to allocate
432MB as it is cleaning up and closing down. Seems very odd to me.
Just increasing memory_limit is not possible (hard limit on server)
and cannot be right as that would just cover something that surely
shouldn't be happening.

Thanks for your help

Mark

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