From: busia at tiscali dot it Operating system: Windows PHP version: 5.3.0RC2 PHP Bug Type: Scripting Engine problem Bug description: Memory leak in array & objects
Description: ------------ When I unset an array containing object, the memory is not freed as expected. Too much memory is still used. Reproduce code: --------------- <? ini_set('memory_limit','300M'); class a { } echo memory_get_usage()."\n"; $a=array(); for ($i=0; $i<=1000000; $i++) { $a[]= new a(); } echo memory_get_usage()."\n"; unset($a); echo memory_get_usage()."\n"; ?> Expected result: ---------------- 325776 230042304 circa 325776 Actual result: -------------- 325776 230042304 33977912 -- Edit bug report at http://bugs.php.net/?id=48368&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48368&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48368&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48368&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48368&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48368&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48368&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48368&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48368&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48368&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48368&r=support Expected behavior: http://bugs.php.net/fix.php?id=48368&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48368&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48368&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48368&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48368&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48368&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48368&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48368&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48368&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48368&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48368&r=mysqlcfg