#9407 [Sus->]: Memory Problem while using self referencing objects...
| From: | derick@php.net | Date: | Wed, 28 Aug 2002 17:52:26 +0000 |
| Subject: | #9407 [Sus->]: Memory Problem while using self referencing objects... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18074@lists.php.net to get a copy of this message | ||
ID: 9407
Updated by: derick@php.net
Reported By: zimt@php.net
-Status: Suspended
+Status: Won't fix
Bug Type: Performance problem
Operating System: Linux (Red Hat 6.1german) on Ker
PHP Version: 4.0.4pl1
Previous Comments:
------------------------------------------------------------------------
[2001-03-09 13:47:12] andre@php.net
cicrular/self references are known to leak memory, not sure
if this can be improved
------------------------------------------------------------------------
[2001-02-22 12:09:20] zimt@php.net
-----configure-----
"./configure" \
"--with-apache=../apache_1.3.14" \
"--with-mysql" \
"--enable-sysvshm" \
"--enable-sysvsem" \
"--with-gd" \
"--enable-trans-sid" \
"--with-config-file-path=/etc/" \
"--enable-url-includes" \
"--enable-magic-quotes" \
"--enable-track-vars" \
"--enable-sockets" \
"--with-jpeg-dir=/root/jpeg-6b/" \
"--with-imap=/root/imap-2000b" \
-----configure-----
maybe i should mention, that
this problem happend with every other configuration i tested (other
Servers) too
-----sample-scripts-----
-----class-one-----
<?php
/**
* Class one
*/
class one
{
/**
* @var object foobar contains reference to this object
*/
var $foobar1;
/**
* @var object foobar2 contains reference to another object
*/
var $foobar2;
/**
* Constructor, putting reference of array including this object in
class var $foobar
* @param object foobar reference to array including this object
*/
function one(&$foobar)
{
$this->foobar1 =& $foobar[0];
$this->foobar2 =& $foobar[1];
}
}
?>
-----class-one-----
-----class-two-----
<?php
/**
* Class one
*/
class two extends some_other_class_but_not_class_one
{
/**
* @var string foo defaults to "bar"
*/
var $foo ="bar";
/**
* Calling constructor of parent class.. nothing from intrest,
* tested this using diffrent classes, this example is just
* meant for those who say "Why dont you just extend class
* one/two to let them work together
*/
function two()
{
$this->some_other_class_but_not_class_one();
}
}
?>
-----class-two-----
-----script------
<?php
include("class.one.php");
include("class.two.php");
/* needed for some reasons, i dont think here is the problem */
session_start();
session_register($classarray);
$classarray[0] = new one($classarray);
$classarray[1] = new two;
?>
-----script------
-----sample-scripts-----
-----problem-----
Execute a set of scripts like this, uhm say 3000 times, youll notice
that
your free mem will get lower and lower...
i noticed that when my mem was full... not really cool...
i think this is a problem of the garbage collection, but im not
sure...
any ideas?
Peter Petermann
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=9407&edit=1