Bug #65340 [Com]: Memory leak when using magic __set ?

From: Date: Fri, 28 Aug 2015 21:30:14 +0000
Subject: Bug #65340 [Com]: Memory leak when using magic __set ?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195609@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65340&edit=1 ID: 65340 Comment by: vitalif at mail dot ru Reported by: vitalif at mail dot ru Summary: Memory leak when using magic __set ? Status: Open Type: Bug Package: Class/Object related Operating System: Linux PHP Version: 5.5.1 Block user comment: N Private report: N New Comment: But of course it's still a bug? :) Previous Comments: ------------------------------------------------------------------------ [2015-08-28 21:21:18] nikic@php.net The reason for this are property recursion guards. In PHP 5 32bit these take 72 bytes per distinct property name that was used with __get/etc. so in this case it would be 72*500000 bytes, which matches your numbers. ------------------------------------------------------------------------ [2015-03-19 12:12:27] php at bof dot de Just tested with 5.6.7, issue is reproducible. ------------------------------------------------------------------------ [2013-10-05 22:04:07] vitalif at mail dot ru Anyone? I've rechecked it on 5.5.4 - the bug is still there. ------------------------------------------------------------------------ [2013-07-27 21:32:43] vitalif at mail dot ru I don't think bug #48197 is related to this issue... There are no memory leaks. I.e. extra alloc done by __call in that bug is freed without problem (if you remove "$b[$i] =" and just throw away the value after each call). And here I describe that an identical object takes twice more memory if you write in its array property using __set. ------------------------------------------------------------------------ [2013-07-26 01:51:01] felipe@php.net See bug #48197 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65340 -- Edit this bug report at https://bugs.php.net/bug.php?id=65340&edit=1

« previous php.bugs (#195609) next »