Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29221 invoked from network); 1 May 2012 01:53:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2012 01:53:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.28 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.28 out4-smtp.messagingengine.com Received: from [66.111.4.28] ([66.111.4.28:48483] helo=out4-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/D0-20924-C024F9F4 for ; Mon, 30 Apr 2012 21:53:17 -0400 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 4399C2109F for ; Mon, 30 Apr 2012 21:53:13 -0400 (EDT) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 30 Apr 2012 21:53:13 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=m2KQCnlh/mnKG3WktXy99O ydYwY=; b=Iu/cMrqRWNoAV2JEvTzlQE4BHgTJCDq64Z63JXnnGGP162OEwX8LSG Rs+G52SMkodTZieUZyIIdcm1g1+n8vMGKz8tE8edtILQlERYlVaHGWqRKdGZvwYN 3scXytEwxSDONDmTv3MddrjUtAqmMU5W+fCtZPgfPBy+5EZMiG+KE= X-Sasl-enc: Fi2m2bJdoBgk2iYr59dbN1bk+F4K/hQUKRv1pz4da8gT 1335837193 Received: from [192.168.42.21] (c-98-220-238-115.hsd1.il.comcast.net [98.220.238.115]) by mail.messagingengine.com (Postfix) with ESMTPSA id F3E3F8E020A for ; Mon, 30 Apr 2012 21:53:12 -0400 (EDT) Message-ID: <4F9F4208.7020106@garfieldtech.com> Date: Mon, 30 Apr 2012 20:53:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: internals@lists.php.net References: <4F9E2173.50005@garfieldtech.com> <000e01cd269a$06f15230$14d3f690$@php.net> <002701cd26b5$1cd0bb70$56723250$@thetaphi.de> <4F9EC8B4.3040600@garfieldtech.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] readfile() memory usage From: larry@garfieldtech.com (Larry Garfield) On 04/30/2012 07:37 PM, Paul Reinheimer wrote: > Hi Larry, > >> 4) So given #2 and #3, the "readfile() will kill your memory, don't use it" >> line is a persistent urban legend that belongs on Snopes as debunked. >> Looping on fread() for performance is a red herring. > I implemented this earlier this very year to avoid memory issues (a > quick look at project history shows me working on it in January). The > difference between using readfile, and some convoluted method from the > documentation comments was clear and immediate: corrupted download > with out of memory error in the logs, to things working just fine. > > Let me re-create with a simple test script and share my server details > before we call snopes :) Fascinating. I even verified the md5sum of the file I got on the other end just to be sure. I'll hold off on the blog post then. :-) I look forward to your test setup. --Larry Garfield