Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20923 invoked by uid 1010); 20 Apr 2004 21:09:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20899 invoked from network); 20 Apr 2004 21:09:28 -0000 Received: from unknown (HELO mx.thebrainroom.net) (65.200.24.98) by pb1.pair.com with SMTP; 20 Apr 2004 21:09:28 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id 63B0814880BC; Tue, 20 Apr 2004 14:09:27 -0700 (PDT) Received: from tron (zaneeb.thebrainroom.net [82.133.1.138]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx.thebrainroom.net (Postfix) with SMTP id 37513148809B for ; Tue, 20 Apr 2004 14:09:24 -0700 (PDT) Message-ID: <010c01c4271b$dd512760$8a02a8c0@tron> To: Date: Tue, 20 Apr 2004 22:10:08 +0100 Organization: The Brain Room Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-TBR-Filter: Virus scanned and defanged Subject: limit for mmaping for readfile (Bug #19749) From: wez@thebrainroom.com ("Wez Furlong") http://bugs.php.net/bug.php?id=19749 It's been playing on my mind recently that this bug hasn't been addressed; the problem was how to guess precisely what limit to set for mmaping when doing something like readfile(). [note that some comments are missing from the bugdb for that bug] Well, we can solve the problem by allowing the sysadmin to decide, as you can see in my patch against PHP 5: http://www.php.net/~wez/mmap-limit.diff The default limit is 8MB. If the limit is set to 0, no limit is applied. This is separate from memory_limit, so PHP could potentially use double the default memory amount for a short period of time. This is still better than allowing it to eat all the RAM when someone decides to readfile() large media files for example. --Wez.