#32403 [Fbk->NoF]: PHP does not free memory, occupied by cross-referencing objects
| From: | php-bugs at lists dot php dot net | Date: | Fri, 01 Apr 2005 23:00:35 +0000 |
| Subject: | #32403 [Fbk->NoF]: PHP does not free memory, occupied by cross-referencing objects | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76191@lists.php.net to get a copy of this message | ||
ID: 32403
Updated by: php-bugs@lists.php.net
Reported By: valyala at tut dot by
-Status: Feedback
+Status: No Feedback
Bug Type: Zend Engine 2 problem
Operating System: any
PHP Version: 5.x
New Comment:
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
Previous Comments:
------------------------------------------------------------------------
[2005-03-25 02:01:40] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
As you were very clever and left all the PHP version information open
(there is no such PHP version as 'Irrelevant'), we now have no idea on
what version you experienced this with first. So try the snapshot.
------------------------------------------------------------------------
[2005-03-21 22:41:22] valyala at tut dot by
Description:
------------
See reproducible code below
Reproduce code:
---------------
<?
/**
cross-referencing memory leak.
PHP garbage collector doesn't free memory for
cross-referencing objects. It could be great
problem for daemons or services, written on PHP
*/
function memleak($size)
{
$a = str_repeat('a', $size);
// construct child
$child = array(
'data' => $a,
);
// construct parent
$parent = array(
'data' => $a,
'child' => &$child,
);
// comment following line to prevent memleak
$child['parent'] = &$parent;
}
// try to leak of 1GB memory
for ($i = 0; $i < 1000; $i++) memleak(1000000);
sleep(10);
?>
Expected result:
----------------
normal execution of script
Actual result:
--------------
PHP occupies all available memory.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32403&edit=1