ID: 48368
Updated by: [email protected]
Reported By: busia at tiscali dot it
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows
PHP Version: 5.3.0RC2
New Comment:
unset != free. The memory is freed once the process shuts down. Until
that, it's available inside the process. This is not a leak.
Previous Comments:
------------------------------------------------------------------------
[2009-05-23 17:24:48] busia at tiscali dot it
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 this bug report at http://bugs.php.net/?id=48368&edit=1