#38591 [Opn->Bgs]: Memory Leak when using pathinfo and DirectoryIterator __toString
| From: | tony2001@php.net | Date: | Tue, 29 Aug 2006 12:09:04 +0000 |
| Subject: | #38591 [Opn->Bgs]: Memory Leak when using pathinfo and DirectoryIterator __toString | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101486@lists.php.net to get a copy of this message | ||
ID: 38591
Updated by: tony2001@php.net
Reported By: rr at d2g dot org dot uk
-Status: Open
+Status: Bogus
Bug Type: *Directory/Filesystem functions
Operating System: win XP
PHP Version: 5.1.5
New Comment:
Duplicate of bug #33487.
Previous Comments:
------------------------------------------------------------------------
[2006-08-29 12:04:57] rr at d2g dot org dot uk
Every time the loop is executed the memory used by php increases by
approx 4k. This happens even though everything is unset. So every loop
the memory usage should return to the minimum amount but this doesn't
happen the memory usage continues to increase.
To view the error, load windows taskman and view the memory usage of
php when running this code. You should see it slowly increasing.
------------------------------------------------------------------------
[2006-08-29 10:08:02] tony2001@php.net
What do you mean by "memory leak" ?
------------------------------------------------------------------------
[2006-08-29 07:03:59] rr at d2g dot org dot uk
Still present when using CSV snapshot.
------------------------------------------------------------------------
[2006-08-25 21:35:42] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-08-25 15:19:24] rr at d2g dot org dot uk
Description:
------------
When running the code below on PHP version 5.1.6. On what seems to be
any directory with files in, have tested with my C:/ and C:/folder/.
The code below is run from the Command Line to recreate the issue.
This is only present when using __toString rather than ->getFileName()
or ->getPathName functions of DirectoryIterator.
A memory leak occours.
Reproduce code:
---------------
<?php
set_time_limit(0);
while(true)
{
$CurrentDir = new DirectoryIterator("C:/");
foreach($CurrentDir as $file)
{
$tmp = pathinfo($file);
print_r($tmp);
}
unset($tmp);
unset($file);
unset($CurrentDir);
sleep(1);
}
?>
Expected result:
----------------
Works.
Actual result:
--------------
Works, but has memory Leak.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38591&edit=1