From:             ilia at manual dot ru
Operating system: FreeBSD 5.2.1
PHP version:      5.0.2
PHP Bug Type:     Reproducible crash
Bug description:  memory leak

Description:
------------
unset() does not free memory.

In the example, list() is important.

Reproduce code:
---------------
for($i=1;$i<10000000;$i++)
{
        list($b['a']) = array ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
        unset($b['a'],$b);
}


Actual result:
--------------
PHP Fatal error:  Allowed memory size of 1048576 bytes exhausted (tried to
alloc
ate 16 bytes) in /tmp/tours2lite.php on line 28

Fatal error: Allowed memory size of 1048576 bytes exhausted (tried to
allocate 1
6 bytes) in /tmp/tours2lite.php on line 28

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

Reply via email to