Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48075 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40180 invoked from network); 26 Apr 2010 02:02:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2010 02:02:13 -0000 Authentication-Results: pb1.pair.com header.from=tly.phpfans@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tly.phpfans@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.221.191 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tly.phpfans@gmail.com X-Host-Fingerprint: 209.85.221.191 mail-qy0-f191.google.com Received: from [209.85.221.191] ([209.85.221.191:56580] helo=mail-qy0-f191.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/32-46677-524F4DB4 for ; Sun, 25 Apr 2010 22:02:13 -0400 Received: by qyk29 with SMTP id 29so7346610qyk.2 for ; Sun, 25 Apr 2010 19:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=Fpbqw60WL9k8ptUVh1hBYno3wwAgKfbDBzWtc0u9Brg=; b=VgcbsT3GhS7ET0y26dmAgock84e8xTPTUiCAYMkYl3weu9CFUOtVAW5Q6JedDva5LU OGhhhzwfnHZEtU7eoqGrp8pnh1rOTE+MBIIUWdDWmS1K8iKv3tIjrTjtKgVswi1L4/bn gKhaNPNwQ26ZvaYnxoJAEEK1yUv1V3/TqKnJQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kvywW4+Z0Bzhqxc1GgB1VFYQneywLF4Rain1kfoQXVLrDkPmqBpjaAqNKiH2kJpYoW MN8rw8MPZZiFCxyODdeh0pVPI6wS3l7ibGQgVTzkUaskmvpJq1sFZOcV4EYg2ysU/KCT sYe1dAWhxYDSL+saTi1ezCISWHsqY7B22mqyg= MIME-Version: 1.0 Received: by 10.224.24.76 with SMTP id u12mr997028qab.170.1272247330502; Sun, 25 Apr 2010 19:02:10 -0700 (PDT) Received: by 10.224.29.6 with HTTP; Sun, 25 Apr 2010 19:02:10 -0700 (PDT) In-Reply-To: References: <4BC58D10.4050609@lerdorf.com> Date: Mon, 26 Apr 2010 10:02:10 +0800 Message-ID: To: =?ISO-8859-1?B?Suly9G1lIExveWV0?= Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=00c09f8e5cc5337bce04851a2a19 Subject: Re: [PHP-DEV] One suggestion to PHP-FPM From: tly.phpfans@gmail.com (looyao teng) --00c09f8e5cc5337bce04851a2a19 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable in linux, read the /proc/self(pid)/status, and the VmRSS(real memory usage= ) or VmSize(virtual memory usage) is the the memory usage of the current process. 2010/4/24 J=E9r=F4me Loyet > 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: > > > > > > + if(zend_memory_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. But, pecl/imagick does seem to use emalloc to > > allocate the imagick objects. However, if the underlying magickwand > > library mallocs a bunch of temporary space on its own, this will not ge= t > > picked up. > > does someone know a way to get the memory usage of the current process ? > getrusage is not accurate in linux. > > Thx > ++ jerome > --00c09f8e5cc5337bce04851a2a19--