php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37596 sha1_file() eating memory like so much nami
Submitted: 2006-05-26 00:29 UTC Modified: 2006-06-03 01:00 UTC
From: jlevy at imerica dot com Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.1.4 OS: Debian GNU/Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-05-26 00:29 UTC] 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 **//



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-26 19:01 UTC] nlopess@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-06-03 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-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 25 06:03:33 2022 UTC