ID:               38505
 Updated by:       [EMAIL PROTECTED]
 Reported By:      trevan at therichins dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Debian sid (linux kernel 2.4.29)
 PHP Version:      5.1.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:
------------------------------------------------------------------------

[2006-08-18 22:04:46] trevan at therichins dot net

Description:
------------
I discovered a memory leak in my script and so was looking through the
database to see if it was fixed in CVS.  That brought me to bug #26982
which is identical to my problem.  The answer given there was that it
is expected behaviour, but I don't quite understand why?  I would have
expected the behaviour to have an increase in memory usage but than
have it stop after the garbage collector catches up.  But, I am instead
seeing the memory constantly increase.  This behaviour prevents PHP from
being used as a Linux service (which is what I am trying to do) as many
php libraries out there use this method to create strings.

Reproduce code:
---------------
<?php
$database = 'mysql';

while (1) {
    $old = memory_get_usage();
    "database_{$database}";
    $new = memory_get_usage();
    echo $new - $old;
    echo "\n";
    sleep(1);
}
?>


Expected result:
----------------
I would expect the memory to go up for a while and then stop as the
garbage collector catches up and cleans out the old strings.

Actual result:
--------------
It shows a constant increase of 16 bytes.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38505&edit=1

Reply via email to