ID:               20913
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: Solaris 8
 PHP Version:      4.2.3
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Well, what if 5 users retrieve the file all your ram will be used up
and the 6ht users will get the error you see here. For performance
reasons fpassthru() uses mmap, which maps the entire file to memory. If
you need to send large files >10megs to the user, use fread() and read
the file in smaller chunks, 1-2 megs, that should prevent memory issues
and maintain reasonable level of performance.


Previous Comments:
------------------------------------------------------------------------

[2002-12-09 18:45:20] [EMAIL PROTECTED]

When I use fpassthru to send large media files (100-500 
MB) to the user, it sometimes causes that Apache thread to 
crash, and it's taken down the entire Solaris box (!) two 
or three times. 
 
Apache's error log entries look like this: 
FATAL:  emalloc():  Unable to allocate 205164673 bytes 
FATAL:  erealloc():  Unable to allocate 205166593 bytes 
FATAL:  erealloc():  Unable to allocate 205166593 bytes 
 
The box has a gig of RAM. Does fpassthru not work with 
large files? Is there a better method? 
 
Thanks 
-Matt 

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20913&edit=1

Reply via email to