#22055 [Fbk->Opn]: Memory leak with references in objects
| From: | jparneodo at yahoo dot fr | Date: | Wed, 05 Feb 2003 19:41:08 +0000 |
| Subject: | #22055 [Fbk->Opn]: Memory leak with references in objects | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32225@lists.php.net to get a copy of this message | ||
ID: 22055
User updated by: jparneodo@yahoo.fr
Reported By: jparneodo@yahoo.fr
-Status: Feedback
+Status: Open
Bug Type: Scripting Engine problem
Operating System: RedHat 7.2
-PHP Version: 4.3.0
+PHP Version: 4.3.1-dev
New Comment:
Same result with PHP Version 4.3.1-dev
php4-STABLE-200302051830.tar.gz
Build Date Feb 5 2003 20:08:24
Previous Comments:
------------------------------------------------------------------------
[2003-02-04 14:37:20] derick@php.net
oops!
you need to development snapshot from snaps.php.net, which should solve
this.
Derick
------------------------------------------------------------------------
[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