Bug #75555 [NEW]: Memory leak in array

From: Date: Wed, 22 Nov 2017 20:21:54 +0000
Subject: Bug #75555 [NEW]: Memory leak in array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212681@lists.php.net to get a copy of this message
From: invader22 at yandex dot ru Operating system: Linux, Ubuntu 16.04 PHP version: 7.0.25 Package: Arrays related Bug Type: Bug Bug description:Memory leak in array Description: ------------ * memory leak in version 7.0+ (7.0.22 from repository ubuntu 16.04; 7.1.5 from sources, minimal configuration) Test script: --------------- $a = array(); for ($j = 1; $j <= 3; $j++) { for ($i = 0; $i < 50000; $i++) { $a[] = range(0, 10); } echo "Memory: ", (memory_get_usage(true) / 1024), " KiB\n"; $a = null; unset($a); $a = array(); echo "Memory: ", (memory_get_usage(true) / 1024), " KiB\n"; } Expected result: ---------------- Memory: 92160 KiB Memory: 768 KiB Memory: 92160 KiB Memory: 768 KiB Memory: 92160 KiB Memory: 768 KiB Actual result: -------------- Memory: 36868 KiB Memory: 34816 KiB Memory: 36868 KiB Memory: 34816 KiB Memory: 36868 KiB Memory: 34816 KiB -- Edit bug report at https://bugs.php.net/bug.php?id=75555&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75555&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75555&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75555&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75555&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75555&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75555&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75555&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75555&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75555&r=support Expected behavior: https://bugs.php.net/fix.php?id=75555&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75555&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75555&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75555&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75555&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75555&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75555&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75555&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75555&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75555&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75555&r=mysqlcfg

« previous php.bugs (#212681) next »