PHP 4.0 Bug #5620: Memory leaks with classes and references to objects

From: Date: Sat, 15 Jul 2000 18:04:18 +0000
Subject: PHP 4.0 Bug #5620: Memory leaks with classes and references to objects
Groups: php.dev 
Request: Send a blank email to php-dev+get-24637@lists.php.net to get a copy of this message
From: h.raaf@i-k-c.net Operating system: Linux PHP version: 4.0.1pl2 PHP Bug Type: Scripting Engine problem Bug description: Memory leaks with classes and references to objects While working on my current project I run into the following memory leak problem: class A { var $Bref=0; function CreateB() { $ob=new B; $this->Bref=&$ob; $this->Bref->Aref=&$this; } } class B { var $Aref=0; } $oa=new A; $oa->CreateB(); --- Results in: ./zend_execute.c(392) : Freeing 0x085D570C (12 bytes), script=/var/www/users/test8/www/classleak.php Last leak repeated 1 time zend_hash.c(271) : Freeing 0x085422A4 (40 bytes), script=/var/www/users/test8/www/classleak.php Last leak repeated 1 time zend_hash.c(200) : Freeing 0x088E6614 (20 bytes), script=/var/www/users/test8/www/classleak.php Last leak repeated 1 time ./zend_execute.c(1895) : Freeing 0x085478E4 (48 bytes), script=/var/www/users/test8/www/classleak.php zend_API.c(208) : Actual location (location was relayed) Last leak repeated 1 time ------ My real project code (a HRXSLT) generates many, many more of this leaks... I just tried to make the shortest program which illustrates the problem. Greetings, Hans Raaf

« previous php.dev (#24637) next »