#37596 [Opn->Fbk]: sha1_file() eating memory like so much nami
| From: | nlopess@php.net | Date: | Fri, 26 May 2006 19:01:34 +0000 |
| Subject: | #37596 [Opn->Fbk]: sha1_file() eating memory like so much nami | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97656@lists.php.net to get a copy of this message | ||
ID: 37596
Updated by: nlopess@php.net
Reported By: jlevy at imerica dot com
-Status: Open
+Status: Feedback
Bug Type: Unknown/Other Function
Operating System: Debian GNU/Linux
PHP Version: 5.1.4
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2006-05-26 00:29:30] jlevy at imerica dot com
Description:
------------
sha1_file() not releasing memory.
After calling thousands of sha1_file() I noticed that memory resources
are not being freed. Script evenually bombs due to lack of resources.
** Note ** I think md5_file() is doing the same thing.
Reproduce code:
---------------
function getFiles(&$rdi,$depth=0) {
if (!is_object($rdi))
return;
for ($rdi->rewind();$rdi->valid();$rdi->next()) {
if ($rdi->isDot())
continue;
if ($rdi->isDir() || $rdi->isFile()) {
if($rdi->isFile()
echo sha1_file($rdi->current());
if ($rdi->hasChildren())
getFiles($rdi->getChildren(),1+$depth);
}
}
}
//** I figured that calling clearstatcache() might help, but no, it
didn't **//
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37596&edit=1