PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #6788

backtrace memory leak

Details

Submitted2006-02-15 07:30 UTC
Fromtouv at ouvaton dot org
Assignedcellog
StatusClosed
PackagePEAR
PHP Version5.1.2
OShp-ux
Roadmaps(Not assigned)

Comments

[2006-02-15 07:30 UTC] touv at ouvaton dot org

Description:
------------
with php version : 5.0.5, 4.4.2, 4.3.10, 4.3.3, 4.2.3
, they are no problem, but with 5.1.1 and 5.1.2 they are un memory leak...

Test script:
---------------
<?php
require_once('PEAR.php');
set_time_limit(0);
for($i = 0; $i < 500000; $i++) {
$ret = PEAR::raiseError('error');
}
?>

Expected result:
----------------
nothing

Actual result:
--------------
<br />
<b>Fatal error</b>: Allowed memory size of 8388608 bytes exhausted (tried to allocate 40 bytes) in <b>/usr/local/apache/pear/share/pear/PEAR.php</b> on line <b>857</b><br />

[2006-03-20 20:36 UTC] pz at ljseek dot com

Hm. Why this would be bogus bug. Is it just expected tor
RaiseError to accocate more and more function in its calls.

The limit of 8MB is not important here - you always can have longer loop and longer running programms.

If Pear developers think it is OK to leak memory this way I would appreciate if there is information outwhere on how to run long running programms with PEAR so they do not leak.

At this point I've been seen similar effects with different PEAR modules - it seems like it is common approach just no to care to free memory, assuming it is used for web page creation and so you can't leak too much anyway.

Currently best approach for writing long running programms with PEAR seems to be forking and killing scripts after few objects were processed so leaks do not hurt you.

[2006-03-21 08:42 UTC] touv at ouvaton dot org

but if I add unset like this
<?php
require_once('PEAR.php');
set_time_limit(0);
for($i = 9; $i < 500000; $i++) {
$ret = PEAR::raiseError('error');
unset($ret);
}
?>

PEAR (or php, I don't know) doesn't free $ret
You do not think that it is a problem ?