#33595 [Opn->Bgs]: Memory leak

From: Date: Wed, 06 Jul 2005 23:03:25 +0000
Subject: #33595 [Opn->Bgs]: Memory leak
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81501@lists.php.net to get a copy of this message
 ID:               33595
 Updated by:       tony2001@php.net
 Reported By:      rodricg at sellingsource dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Linux
 PHP Version:      5.0.4
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #33487.


Previous Comments:
------------------------------------------------------------------------

[2005-07-06 23:44:25] rodricg at sellingsource dot com

Description:
------------
Objects with recursive references leak memory. 
PHP 5.1.0b2 exhibits the same behavior. 

Reproduce code:
---------------
<?php
class A {
    function __construct () {
        $this->b = new B($this);
    }
}

class B {
    function __construct ($parent = NULL) {
        $this->parent = $parent;
    }
}

for ($i = 0 ; $i < 1000000 ; $i++) {
    $a = new A();
}
?>

Expected result:
----------------
Memory usage should remain constant. 

Actual result:
--------------
Memory usage quickly increases to consume several hundred 
megabytes. 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33595&edit=1


Thread (22 messages)

« previous php.bugs (#81501) next »