#22055 [Fbk]: Memory leak with references in objects
| From: | derick@php.net | Date: | Tue, 04 Feb 2003 20:37:21 +0000 |
| Subject: | #22055 [Fbk]: Memory leak with references in objects | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32110@lists.php.net to get a copy of this message | ||
ID: 22055
Updated by: derick@php.net
Reported By: jparneodo@yahoo.fr
Status: Feedback
Bug Type: Scripting Engine problem
Operating System: RedHat 7.2
PHP Version: 4.3.0
New Comment:
oops!
you need to development snapshot from snaps.php.net, which should solve
this.
Derick
Previous Comments:
------------------------------------------------------------------------
[2003-02-04 14:36:48] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-02-04 14:35:56] jparneodo@yahoo.fr
/*
If you don't set the UP property,
garbage collection is done in real time
If you set the UP property,
garbage collection is done on script shutdown only
and the VmSize increase.
This is a test case
but if a sub-object (in some package) creates a
circular reference with a sub-sub-object you leak
memory without the knowledge of it.
*/
for($i=1;$i<=$nb_loop;$i++){
echo "<br>loop $i";
flush();
for($j=1;$j<=$nb_by_loop;$j++){
$a=&new A(500);
$a->b=&new B(500);
$a->b->UP=&$a; // Memory Leak here
// unset($a->b->up);
}
sleep($sleep_by_loop);
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22055&edit=1