#22055 [Opn->Fbk]: Memory leak with references in objects

From: Date: Thu, 06 Feb 2003 14:31:40 +0000
Subject: #22055 [Opn->Fbk]: Memory leak with references in objects
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32286@lists.php.net to get a copy of this message
ID: 22055 Updated by: sniper@php.net Reported By: jparneodo@yahoo.fr -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: RedHat 7.2 PHP Version: 4.3.1-dev New Comment: You were supposed to test this snapshot: http://snaps.php.net/php5-latest.tar.gz Previous Comments: ------------------------------------------------------------------------ [2003-02-05 13:41:08] jparneodo@yahoo.fr Same result with PHP Version 4.3.1-dev php4-STABLE-200302051830.tar.gz Build Date Feb 5 2003 20:08:24 ------------------------------------------------------------------------ [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

« previous php.bugs (#32286) next »