Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25521 invoked from network); 1 May 2012 00:37:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2012 00:37:41 -0000 Authentication-Results: pb1.pair.com header.from=preinheimer@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=preinheimer@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.45 as permitted sender) X-PHP-List-Original-Sender: preinheimer@gmail.com X-Host-Fingerprint: 209.85.210.45 mail-pz0-f45.google.com Received: from [209.85.210.45] ([209.85.210.45:35282] helo=mail-pz0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/60-20924-4503F9F4 for ; Mon, 30 Apr 2012 20:37:41 -0400 Received: by dacx6 with SMTP id x6so4580527dac.18 for ; Mon, 30 Apr 2012 17:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=/V+nZIzN/2JlZB2TZVKw7hWMk3n9A5dNPlOeZxE9uq8=; b=yCwOYsbZjNxb+mdJmun1dyz5Fw1kDQseitlC7e4KgkNwb4caTwyXhObzxEVSsNn4y9 yZ58O1jtOjOGrYjeHgAOB41CrMLNNmAaIBqUesq96LkZGCrGiNOQrNmI12Y8nXFpmsNo Jk4T2jzeYYSYDeMGdalHRx+FLbeHreYQSSEwCAL2EVz+TjtHCosyVIrHAynD1J8oLSY8 kdky/cVFDEaOcCNpATbA5kM+R97cLiFJ8U4mW45AQ50ioPgZ4DIvJzFBV3WgGnm20/tn 1isY+USzew7xFjPejSVjTDM6tnU2/yJJeWHv6Hb1YXqbuOkY1jAljFjiKJuIrU3saL3d v3bw== MIME-Version: 1.0 Received: by 10.68.216.33 with SMTP id on1mr16667739pbc.105.1335832657885; Mon, 30 Apr 2012 17:37:37 -0700 (PDT) Received: by 10.142.188.6 with HTTP; Mon, 30 Apr 2012 17:37:37 -0700 (PDT) In-Reply-To: <4F9EC8B4.3040600@garfieldtech.com> References: <4F9E2173.50005@garfieldtech.com> <000e01cd269a$06f15230$14d3f690$@php.net> <002701cd26b5$1cd0bb70$56723250$@thetaphi.de> <4F9EC8B4.3040600@garfieldtech.com> Date: Mon, 30 Apr 2012 20:37:37 -0400 Message-ID: To: internals@lists.php.net Cc: Larry Garfield Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] readfile() memory usage From: preinheimer@gmail.com (Paul Reinheimer) Hi Larry, > 4) So given #2 and #3, the "readfile() will kill your memory, don't use i= t" > line is a persistent urban legend that belongs on Snopes as debunked. > =A0Looping 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 :) paul