Edit report at https://bugs.php.net/bug.php?id=46103&edit=1
ID: 46103 Updated by: larue...@php.net Reported by: jim dot keller at contextsolutions dot net Summary: ReflectionObject memory leak Status: Open Type: Bug Package: Performance problem Operating System: Windows XP PHP Version: 5.2.6 Block user comment: N Private report: N New Comment: it seems because the object pass to ReflectionObject::__construct is stored in a custom struct, which can not be reached by gc_collect_cycles. Previous Comments: ------------------------------------------------------------------------ [2011-09-27 05:43:17] larue...@php.net hmm, seems not a ZE issue ------------------------------------------------------------------------ [2011-09-27 05:11:45] larue...@php.net I can reproduce.. dmitry plz look at this . ------------------------------------------------------------------------ [2011-09-27 04:03:04] eric dot muyser at gmail dot com Not bogus. Still an issue in 5.3.8. https://gist.github.com/1244305 ------------------------------------------------------------------------ [2008-09-20 12:38:35] fel...@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