From: [EMAIL PROTECTED]
Operating system: Redhat 7.0
PHP version: 4.3.0RC2
PHP Bug Type: Scripting Engine problem
Bug description: "array()" don't free memory
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 bug report at http://bugs.php.net/?id=20844&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20844&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20844&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20844&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20844&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20844&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20844&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20844&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20844&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20844&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20844&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20844&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20844&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20844&r=isapi