#20844 [Opn]: "array()" doesn't free memory

From: Date: Thu, 05 Dec 2002 23:06:45 +0000
Subject: #20844 [Opn]: "array()" doesn't free memory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-26799@lists.php.net to get a copy of this message
ID: 20844 User updated by: busia@tiscali.it -Summary: "array()" don't free memory Reported By: busia@tiscali.it Status: Open Bug Type: Scripting Engine problem Operating System: Redhat 7.0 PHP Version: 4.3.0RC2 New Comment: I have reproduced the problem also on an ther server (this server uses redhat 7.2) Previous Comments: ------------------------------------------------------------------------ [2002-12-05 17:01:54] busia@tiscali.it If I add the line unset($array); before $array=array(); (line: 8) the result remains the same. ------------------------------------------------------------------------ [2002-12-05 16:55:34] busia@tiscali.it If I run this script: <? ini_set('memory_limit','100M'); echo "a"; $array=array(); for($i=0; $i<=500000; $i++) $array[]="pippoplu"; echo "b\n"; sleep(15); $array=array(); echo "c\n"; sleep(15); for($i=0; $i<=300000; $i++) $array[]="pippoplu"; echo "d\n"; sleep(15); ?> and I watch the memory usage i see: after the 'echo "a"': memory usage increases and it reaches 64MB (all is ok) after the 'echo "b"': memory usage is 64MB (all is ok) after the 'echo "c"': memory usage is 62MB (not ok) after the 'echo "d"': memory usage remains 62MB (not ok) Why '$array=array();' don't free the memory used by $array? and why the memory don't increases when between ' echo "c"' and 'echo "d"'? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20844&edit=1

« previous php.bugs (#26799) next »