Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25005 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90471 invoked by uid 1010); 27 Jul 2006 13:31:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 90442 invoked from network); 27 Jul 2006 13:31:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2006 13:31:51 -0000 Authentication-Results: pb1.pair.com header.from=iliaal@gmail.com; domainkeys=good DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: iliaal@gmail.com X-Host-Fingerprint: 64.233.184.224 wr-out-0506.google.com Linux 2.4/2.6 Received: from ([64.233.184.224:36222] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id CE/8F-23194-6AAB8C44 for ; Thu, 27 Jul 2006 09:07:50 -0400 Received: by wr-out-0506.google.com with SMTP id i5so50300wra for ; Thu, 27 Jul 2006 06:07:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=OHLfOGwciy/7IBNN011wCIjX9ztiJwKWLlh8iLOFqx5JbULRBK82P4pdlfncAiV6KFxPPUBCI+fiOS/Y7+rRO4E+qCUkUEw3OmPLCYebIq2qYpLnQs/rIpCPY/jUdkksF2DdlCyqDNNpVhzgp/wmD/JkQrwhL10Gw++5Q3swdtA= Received: by 10.64.125.17 with SMTP id x17mr9027451qbc; Thu, 27 Jul 2006 06:07:48 -0700 (PDT) Received: from ?192.168.1.6? ( [72.59.8.142]) by mx.gmail.com with ESMTP id e19sm320506qbe.2006.07.27.06.07.47; Thu, 27 Jul 2006 06:07:47 -0700 (PDT) In-Reply-To: <44C8B9B8.5030108@toggg.com> References: <00d601c6af9d$c18f2d30$0201a8c0@pc1> <003701c6afb1$81b87720$6e02a8c0@thinkpad> <44C6205F.4090808@php.net> <00ed01c6b163$c3d40ad0$0201a8c0@pc1> <44C8B9B8.5030108@toggg.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <70339B16-D50B-45B9-A55D-B58F9EEB679D@prohost.org> Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Thu, 27 Jul 2006 09:07:44 -0400 To: bertrand@toggg.com X-Mailer: Apple Mail (2.752.2) Sender: Ilia Alshanetsky Subject: Re: [PHP-DEV] memory_get_usage with new Memory Manager From: ilia@prohost.org (Ilia Alshanetsky) On 27-Jul-06, at 9:03 AM, bertrand Gugger wrote: > Ilia Alshanetsky wrote: >> On 27-Jul-06, at 6:02 AM, Matt W wrote: >>> >>> Something else I'd like to see changed... Does anyone think >>> memory_get_[peak_]usage() should *always* be available, >>> regardless of >>> whether memory_limit is actually enabled? Using the Windows >>> binaries at >>> least, I was devastated :-D that they were unavailable for >>> experimenting, >>> etc. >>> >> Counting memory all the time adds a fair amount of overhead to >> script execution especially given how frequently PHP needs to >> allocate memory. Therefore usage memory utilization functions are >> only available when PHP is compiled with memory in which case it >> keeps track of its mem usage. > > 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. 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. > 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. Ilia Alshanetsky