Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48072 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40429 invoked from network); 23 Apr 2010 22:25:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Apr 2010 22:25:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=jerome@loyet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jerome@loyet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain loyet.net from 209.85.218.216 cause and error) X-PHP-List-Original-Sender: jerome@loyet.net X-Host-Fingerprint: 209.85.218.216 mail-bw0-f216.google.com Received: from [209.85.218.216] ([209.85.218.216:37110] helo=mail-bw0-f216.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/24-57655-96E12DB4 for ; Fri, 23 Apr 2010 18:25:46 -0400 Received: by bwz8 with SMTP id 8so10579161bwz.23 for ; Fri, 23 Apr 2010 15:25:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.4.135 with SMTP id 7mr412934bkr.99.1272061540615; Fri, 23 Apr 2010 15:25:40 -0700 (PDT) Received: by 10.204.134.152 with HTTP; Fri, 23 Apr 2010 15:25:40 -0700 (PDT) In-Reply-To: <4BC58D10.4050609@lerdorf.com> References: <4BC58D10.4050609@lerdorf.com> Date: Sat, 24 Apr 2010 00:25:40 +0200 Message-ID: To: Rasmus Lerdorf Cc: =?UTF-8?B?5ruV6Lev6YGl?= , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] One suggestion to PHP-FPM From: jerome@loyet.net (=?ISO-8859-1?B?Suly9G1lIExveWV0?=) 2010/4/14 Rasmus Lerdorf > > On 04/14/2010 02:01 AM, J=E9r=F4me Loyet wrote: > > The patch seems good (I didn't test it yet) but I'm curious about the > > way you check the memory real size: > > > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if(zend_memor= y_usage(1 TSRMLS_CC) > > > fpm_global_config.term_on_memory_limit){ > > > > I don't know much about the zend_memory_usage() function. But does it > > return the real memory size of the process ? > > Right, that will only give you the memory allocated by the memory > manager, obviously. =A0But, pecl/imagick does seem to use emalloc to > allocate the imagick objects. =A0However, if the underlying magickwand > library mallocs a bunch of temporary space on its own, this will not get > picked up. does someone know a way to get the memory usage of the current process ? getrusage is not accurate in linux. Thx ++ jerome