Re: readfile() memory usage

From: Date: Thu, 03 May 2012 03:13:18 +0000
Subject: Re: readfile() memory usage
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-60425@lists.php.net to get a copy of this message
On 05/01/2012 11:40 AM, Larry Garfield wrote:
On 5/1/12 10:01 AM, Paul Reinheimer wrote:
Hi All,
Unfortunately, you've ignored Uwe's e-mail... The problem is not the PHP version; the problem is that you're buffering unlimited amounts of data. Check your configuration and make sure ob_get_level() returns 0.
My apologies in the delay, ob_get_level() returns 1, good catch. phpinfo() reports output_buffering as 4096 Does this push what I'm getting into expected behaviour? paul
It sounds like it. In that case the memory spike is happening in the output buffer, where the file is streamed into by readfile() in 8K chunks until the output buffer explodes. :-) So, I think we're back to "urban legend" territory. --Larry Garfield
Thanks for the sanity check, everyone. I've put together a blog post with my findings. If anyone wants to check it to make sure I am not saying anything grotesquely wrong before I posted it, that would be much appreciated. :-) It's set to world-commentable: https://docs.google.com/document/d/1qfe4OUc5lbuoSZFUh6NZYP-6pbaiquxnOFwN_oBccBI/edit --Larry Garfield

« previous php.internals (#60425) next »