php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #13516 fpassthru uses too much memory
Submitted: 2001-10-02 12:39 UTC Modified: 2002-02-09 23:56 UTC
From: maardsma at arpinternational dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.6 OS: Irix
Private report: No CVE-ID: None
 [2001-10-02 12:39 UTC] maardsma at arpinternational dot com
When using fpassthru to output the contents of a large >1MB file it uses a lot of memory which causes my ISP's web server to terminate the httpd thread because it used too much memory. As a result the download is cut off.

If I use fread to read the file 1K at a time it works ok. 

Shouldn't fpassthru read a 1 or 10K chunks to avoid excess memory use on large files?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-14 06:48 UTC] sander@php.net
Not a bug. Reclasified as a feature/change request.
 [2002-02-09 23:56 UTC] jimw@php.net
fpassthru() uses mmap() or does pass the file in chunks. it doesn't consume real memory.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 12:01:29 2025 UTC