|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-21 21:32 UTC] cataphract@php.net
-Status: Open
+Status: Bogus
[2010-09-21 21:32 UTC] cataphract@php.net
[2010-09-21 21:57 UTC] jcampbell at remindermedia dot com
[2010-09-21 22:12 UTC] cataphract@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 23:00:02 2025 UTC |
Description: ------------ The behavior originally reported in #33595 still exists, namely, "Objects with recursive references leak memory." Test script: --------------- class A { function __construct () { $this->b = new B($this); } } class B { function __construct ($parent = NULL) { $this->parent = $parent; } } echo memory_get_usage() . "\n"; for ($i = 0 ; $i < 1000000 ; $i++) { $a = new A(); } echo memory_get_usage() . "\n"; Expected result: ---------------- Memory usage should remain relatively constant. For example, if you change the one line to: "$this->parent = clone $parent;" Then the output is: 632216 632392 Actual result: -------------- Memory usage increases with each newly instantiated object. Actual output: 631976 1756792