Re: Memory Leaks /w nested classes

From: Date: Mon, 10 Jun 2002 20:40:33 +0000
Subject: Re: Memory Leaks /w nested classes
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-85102@lists.php.net to get a copy of this message
Hi, that's a limitation of the Zend Engine. It does not support circular references (at least this is would Zeev told me last time :) - Markus On Mon, Jun 10, 2002 at 10:25:38PM +0200, Andre Christ wrote : > working with php's oop implementation I got some memory leaks. The behaviour > can be reproduced > with the following script: > > <?php > class CBar { > var $Parent; > } > > class CSuper { > function CSuper() { > $this->Bar = new CBar(); > $this->Bar->Parent = $this; > } > } > > $Super = new CSuper(); > ?> > > php 4.2.1 --enable-debug > > zend_hash.c(260) : Freeing 0x0821000C (39 bytes), > script=/home/ach/usr/htdocs/devel/oop.php > Last leak repeated 1 time > ./zend_execute.c(470) : Freeing 0x0820FFAC (44 bytes), > script=/home/ach/usr/htdocs/devel/oop.php > zend_variables.c(126) : Actual location (location was relayed) > ./zend_execute.c(467) : Freeing 0x0820FF6C (12 bytes), > script=/home/ach/usr/htdocs/devel/oop.php > zend_API.c(596) : Freeing 0x0820FE54 (44 bytes), > script=/home/ach/usr/htdocs/devel/oop.php > zend_API.c(584) : Actual location (location was relayed) > zend_hash.c(176) : Freeing 0x0820FB34 (32 bytes), > script=/home/ach/usr/htdocs/devel/oop.php > Last leak repeated 1 time > ./zend_execute.c(1948) : Freeing 0x0820F844 (12 bytes), > script=/home/ach/usr/htdocs/devel/oop.php > > > Is there anything wrong with the code or is it a bug in php / Zend ? -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

« previous php.dev (#85102) next »