Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47944 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78933 invoked from network); 15 Apr 2010 01:59:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2010 01:59:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=tly.phpfans@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tly.phpfans@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.221.173 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.173 mail-qy0-f173.google.com Received: from [209.85.221.173] ([209.85.221.173:41313] helo=mail-qy0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/91-61565-4E276CB4 for ; Wed, 14 Apr 2010 21:59:01 -0400 Received: by qyk4 with SMTP id 4so941513qyk.17 for ; Wed, 14 Apr 2010 18:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=i7NzYgV19RoFGlhwo4/KFAhk3B5Eds102VptdkcdoYM=; b=iOWTIFLeV2nc1Sd4R+b4PP7b+eMx+3WXbCMn4PbJZm2gkqX/g8MwSo/YvFWFpxGaof 9dSDvzdKEfrjN/a1HV+B/Z97GXe8CEIPrmRYDQ695OjUJATmnrS+qCPIxHQpBa8kHUUV rFDbOa4H1OPOtoDXZR0h6jy784eo3OxPaWhMA= 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=KamWa0kgftgI4Olr6a7eRKnvOtXtJKhgptDbV2btN2gvm6+n02+JmTaHHBua62Kkxr Ggmv5NlazVftnFdQ/HBRnfkDGa93KOB+015Lv3syL/imA4Jz1oQDQHPJ5aQz4eKDpocK RYge4/G0JZWjtjvMJIG3CkM4DrulZi1Hp8U9o= MIME-Version: 1.0 Received: by 10.224.80.146 with HTTP; Wed, 14 Apr 2010 18:58:57 -0700 (PDT) In-Reply-To: <4BC58D10.4050609@lerdorf.com> References: <4BC58D10.4050609@lerdorf.com> Date: Thu, 15 Apr 2010 09:58:57 +0800 Received: by 10.224.50.80 with SMTP id y16mr2920021qaf.375.1271296738015; Wed, 14 Apr 2010 18:58:58 -0700 (PDT) Message-ID: To: Rasmus Lerdorf Cc: =?ISO-8859-1?B?Suly9G1lIExveWV0?= , internals@lists.php.net Content-Type: multipart/alternative; boundary=000feaee5d5f793d9b04843cd66b Subject: Re: [PHP-DEV] One suggestion to PHP-FPM From: tly.phpfans@gmail.com (=?GB2312?B?6/jCt9Kj?=) --000feaee5d5f793d9b04843cd66b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable We check error log after our server crashed, and we found that php heap memory is out of limit, so I think imagick use emalloc to allocate php heap memory, to check the zend_memory_usage is not a method for imagick, other circumstances which occupy huge memory can use this method to ensure the system have enough free memory. thanks, looyao 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 get > picked up. > > -Rasmus > --000feaee5d5f793d9b04843cd66b--