#46103 [Opn->Bgs]: ReflectionObject memory leak
ID: 46103
Updated by: felipe@php.net
Reported By: jim dot keller at contextsolutions dot net
-Status: Open
+Status: Bogus
Bug Type: Performance problem
Operating System: Windows XP
PHP Version: 5.2.6
New Comment:
Try using memory_get_usage(true).
http://docs.php.net/memory-get-usage
I don't found any memory leak.
Previous Comments:
------------------------------------------------------------------------
[2008-09-17 04:26:42] jim dot keller at contextsolutions dot net
Description:
------------
when a reflector is stored in a class property, the reflector appears
to stay in memory after the object is destroyed. This could be related
to #33595
Reproduce code:
---------------
class testclass {
protected $_r;
public function __construct() {
$this->getr();
}
public function getr() {
if ( !$this->_r ) $this->_r = new ReflectionObject($this);
return $this->_r;
}
}
for ( $j = 0; $j < 100; $j++ ) {
$t = new testclass();
echo memory_get_usage() . '<br />';
}
Expected result:
----------------
memory usage should stay constant
Actual result:
--------------
memory usage increases with every iteration
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46103&edit=1
Thread (9 messages)