php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30501 memory leak
Submitted: 2004-10-20 20:31 UTC Modified: 2004-11-01 01:00 UTC
Votes:9
Avg. Score:3.8 ± 1.3
Reproduced:7 of 8 (87.5%)
Same Version:2 (28.6%)
Same OS:1 (14.3%)
From: ilia at manual dot ru Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.0.2 OS: FreeBSD 5.2.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-10-20 20:31 UTC] ilia at manual dot ru
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-20 21:41 UTC] ilia at manual dot ru
Memory limit was 1M for this test
 [2004-10-21 18:55 UTC] wedro at gmx dot net
the same here:

linux 2.2.25
PHP 5.0.2 (cli)

FATAL:  emalloc():  Unable to allocate 37 bytes
 [2004-10-24 14:11 UTC] no at mail dot ru
Had same not only on php5, but on PHP4.3.9 also
 [2004-10-24 14:15 UTC] tony2001@php.net
Try latest 4.3.10 snapshots. 
I can't reproduce it with 4.3.x branch.
 [2004-11-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 19:01:32 2024 UTC