Re: handling large files w/readfile

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

 



On Sunday 02 January 2005 16:43, Robin Getz wrote:
> 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

Are you using the above code on its own (ie not within some other code that 
may affect the memory usage)?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts

-- 
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