From:             rxk at gmx dot de
Operating system: win2000/Linux
PHP version:      4.3.4
PHP Bug Type:     Arrays related
Bug description:  Array recrusion make Memory leak

Description:
------------
unset don't free the memory.

Reproduce code:
---------------
<?php

set_time_limit(0);

$a=array();



for($j=0;$j<5;$j++) {

        for($i=0;$i<20000;$i++) {

        

                $a[$i] = array(1,2,3,4,5);

                $a[$i][] = &$a[$i];



        }

        echo "before unset\n";sleep(5);

        unset($a);

        echo "after unset\n";sleep(5);

}

?>

Actual result:
--------------
There is none differentiated before or after unset.

The memory overflows.

-- 
Edit bug report at http://bugs.php.net/?id=27376&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27376&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27376&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27376&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27376&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27376&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27376&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27376&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27376&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27376&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27376&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27376&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27376&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27376&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27376&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27376&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27376&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27376&r=float

Reply via email to