But, PHP if not written correctly will use up 2GB of memory easily from loosing reference to arrays or setting globals and forgetting about them; stuff like that. This is especially visible in long running applications.
PEAR is not immune to these memory leaks. So, to get around reference problems in PEAR I do
$skiptrace =& PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
$skiptrace = false;
This prevents this error
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 76 bytes) in /usr/share/pear/PEAR.php on line 872
from long running processes.
Thought I pass it along.
5 comments:
So this is PHP4?
Amen, brother. I love this sort of re-use. I've found myself using PHP for more and more of my command-line scripts instead of rewriting classes into Perl.
In fact, it is due to object references in the stack trace generated by the debug_backtrace() function. So we get some nice circular references between objects, that the garbage collector cannot handle (I am talking about PHP >5).
see this bug
@evert: PHP5
This looks like a bug in PEAR, doesn't it ?
Post a Comment