|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-23 17:26 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
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