Re: handling large files w/readfile

From: Date: Tue, 04 Jan 2005 11:52:07 +0000
Subject: Re: handling large files w/readfile
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-205580@lists.php.net to get a copy of this message
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

« previous php.general (#205580) next »