Bug #46103 [Com]: ReflectionObject memory leak
Edit report at https://bugs.php.net/bug.php?id=46103&edit=1
ID: 46103
Comment by: eric dot muyser at gmail dot com
Reported by: jim dot keller at contextsolutions dot net
Summary: ReflectionObject memory leak
Status: Bogus
Type: Bug
Package: Performance problem
Operating System: Windows XP
PHP Version: 5.2.6
Block user comment: N
Private report: N
New Comment:
Not bogus. Still an issue in 5.3.8. https://gist.github.com/1244305
Previous Comments:
------------------------------------------------------------------------
[2008-09-20 12:38:35] felipe@php.net
Try using memory_get_usage(true).
http://docs.php.net/memory-get-usage
I don't found any memory leak.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=46103&edit=1
Thread (9 messages)