Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25027 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12117 invoked by uid 1010); 28 Jul 2006 05:56:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12101 invoked from network); 28 Jul 2006 05:56:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2006 05:56:16 -0000 X-PHP-List-Original-Sender: bertrand@toggg.com X-Host-Fingerprint: 212.27.42.36 smtp6-g19.free.fr Linux 2.4 (Google crawlbot) Received: from ([212.27.42.36:48732] helo=smtp6-g19.free.fr) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 19/06-23194-FF6A9C44 for ; Fri, 28 Jul 2006 01:56:16 -0400 Received: from [192.168.0.3] (lns-bzn-44-82-64-95-239.adsl.proxad.net [82.64.95.239]) by smtp6-g19.free.fr (Postfix) with ESMTP id D45C6225C9; Fri, 28 Jul 2006 07:56:11 +0200 (CEST) Message-ID: <44C9A822.2070404@toggg.com> Date: Fri, 28 Jul 2006 08:01:06 +0200 Reply-To: bertrand@toggg.com User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ilia Alshanetsky CC: internals@lists.php.net References: <00d601c6af9d$c18f2d30$0201a8c0@pc1> <003701c6afb1$81b87720$6e02a8c0@thinkpad> <44C6205F.4090808@php.net> <00ed01c6b163$c3d40ad0$0201a8c0@pc1> <44C8B9B8.5030108@toggg.com> <70339B16-D50B-45B9-A55D-B58F9EEB679D@prohost.org> In-Reply-To: <70339B16-D50B-45B9-A55D-B58F9EEB679D@prohost.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] memory_get_usage with new Memory Manager From: bertrand@toggg.com (bertrand Gugger) Ilia Alshanetsky wrote: > > On 27-Jul-06, at 9:03 AM, bertrand Gugger wrote: > >> >> That may hear off topic , but how you enable something else than 8M >> *without* getting this counting overhead ? > > > Eh? When you set a limit what are you trying to do? From my experience > most of the time this setting is used by hosting providers to restrict > memory utilization of various PHP scripts to avoid out-of- memory > situations and system abuse. The most cases I saw were providers or production site wanting to grant *more* than 8M (typically 16M) to their customers / users. I dont call that a "restriction". You should know this 8M limit is reached very easily. e.g. lot of popular CMS wont work below this limit as soon as they have a litle contents. > As such you'd want as accurate measurement > as possible including any overhead and what not, since it is possible > to use the overhead to exceed or in some cases even to bypass the > memory limit entirely. You miss the point , they don't care about accuracy, they just don't want the default 8M but more. > >> It looks to me that --enable-memory-limit mixes 2 independant roles : >> - setting the amount of available memory, and enabling eventually >> local setting, >> - enabling the evaluation of the process consumption. > > > That is correct. Memory limit by its nature requires PHP to count the > amount of memory consumed, since such tracking is performed it enabled > PHP to report internally via functions (or via Apache log) about its > memory utilization. I have no idea how it works internally ... Are you meaning the default "hard-coded" 8M limit is magic and will not need to count the amount of memory consumed but any custom setting will ? -- toggg