Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60373 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64685 invoked from network); 30 Apr 2012 08:05:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2012 08:05:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:56211] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/49-13197-2D74E9F4 for ; Mon, 30 Apr 2012 04:05:39 -0400 Received: by yhfq11 with SMTP id q11so1336754yhf.29 for ; Mon, 30 Apr 2012 01:05:36 -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; bh=BhnJtrexFmn9qQb9WJRw26TBcfBTDaZcZvxhKwLnurA=; b=qkSX5h4L7rsQDCuY+wvm9IgU2sBqffy7zmgLt3pTLovh63pku+zwdIMtCJ8Y+tAA1g Zeh3yaTRLMeEmSOidMiT/z2GcWoicB3KBQByw49beqlc+8zSJZfI1J+gWizH15tshgCP GuZFHdKsD6UWiehapX79AyNlqFUOOq1e62CWw0If1vBynZ9OcewKo8HFWWh+wx2SPJU2 rPUm7Tna+N+lp+GY4l35R6hz1mZoM2lSGBBcmJzInauLHEuNvwEwX2Ig12ZmH+aDrOjt K+nS0duhspPwzNSOAlvCIpcnHh3Fil7R6Zx62E92MEQXc47zKaHemv6R0bIRKfi8M3r5 6uGQ== MIME-Version: 1.0 Received: by 10.236.9.36 with SMTP id 24mr21047835yhs.19.1335773135971; Mon, 30 Apr 2012 01:05:35 -0700 (PDT) Received: by 10.147.32.16 with HTTP; Mon, 30 Apr 2012 01:05:35 -0700 (PDT) In-Reply-To: <000e01cd269a$06f15230$14d3f690$@php.net> References: <4F9E2173.50005@garfieldtech.com> <000e01cd269a$06f15230$14d3f690$@php.net> Date: Mon, 30 Apr 2012 10:05:35 +0200 Message-ID: To: Uwe Schindler Cc: Larry Garfield , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] readfile() memory usage From: pierre.php@gmail.com (Pierre Joye) hi! On Mon, Apr 30, 2012 at 8:25 AM, Uwe Schindler wrote: > - If the underlying stream allows MMAP, it will use memory mapping (mapping > file to *virtual* memory) and copy the mapped buffer to output. Please note > memory mapping does *not* load the file into memory, it only *maps* the file > contents to virtual memory like a swap file > (http://en.wikipedia.org/wiki/Mmap). Some additional notes: mmap may use "normal" memory too, depending on the options (not sure which are used exactly with readfile or stream's mmap). About php memory usage, one has to use an external tools to actually see this memory usage as it is not managed by the zend memory manager. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org