RE: handling large files w/readfile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rasmus Lerdorf wrote:
>> ============================
>> $buff = "0";
>> while (!feof($fp)) {
>>    $buff = fread($fp, 4096);
>>    print $buff;
>> }
>> unset($buff);
>> fclose ($fp);
>> ============================

Well, the above code does not use more than 4K of ram plus a bit of overhead. So if something is causing your processes to grow to 450M you need to look elsewhere because this code is definitely not the cause.

Well, the test case is: 1) above with big files = big apache processes - machine crashes

2) download big files with:
     Header("Location: ".$html_pointer_to_file);
   = small apache processes - works great

So, I don't know if it can be anything else but that - so I am open to suggestions, or tests that anyone wants me to run.

-Robin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux