Bug #77209 [NEW]: Leaks memory

From: Date: Tue, 27 Nov 2018 12:09:57 +0000
Subject: Bug #77209 [NEW]: Leaks memory
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218159@lists.php.net to get a copy of this message
From: silicid at gmail dot com Operating system: Debian 8 PHP version: 7.2.12 Package: Performance problem Bug Type: Bug Bug description:Leaks memory Description: ------------ You must create a file with the specified code. If you execute method "is_object" from "$this" and unset the object, then leaks memory. But if you call method "is_object" for "$object", then there are no problems. In version 7.1 there are no problems. There are no problems in Windows. Test script: --------------- <?php class Test { public function __construct() { for ($i = 0; $i < 1000; ++$i) { $this->result[] = rand(1, 1000); } } function object() { is_object($this); } } $memory = memory_get_usage(); for ($i = 0; $i < 1; ++$i) { $object = new Test(); $object->object(); unset($object); } var_dump(memory_get_usage() - $memory); $memory = memory_get_usage(); for ($i = 0; $i < 100; ++$i) { $object = new Test(); $object->object(); unset($object); } var_dump(memory_get_usage() - $memory); $memory = memory_get_usage(); for ($i = 0; $i < 100; ++$i) { $object = new Test(); is_object($object); unset($object); } var_dump(memory_get_usage() - $memory); Expected result: ---------------- int(0) int(0) int(0) Actual result: -------------- int(37336) int(3733600) int(0) -- Edit bug report at https://bugs.php.net/bug.php?id=77209&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77209&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77209&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77209&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77209&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77209&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77209&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77209&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77209&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77209&r=support Expected behavior: https://bugs.php.net/fix.php?id=77209&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77209&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77209&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77209&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77209&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77209&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77209&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77209&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77209&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77209&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77209&r=mysqlcfg

« previous php.bugs (#218159) next »