Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35574 invoked from network); 14 Apr 2010 09:38:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2010 09:38:44 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 74.125.82.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:41845] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/AF-07606-32D85CB4 for ; Wed, 14 Apr 2010 05:38:44 -0400 Received: by wyb34 with SMTP id 34so2263411wyb.29 for ; Wed, 14 Apr 2010 02:38:40 -0700 (PDT) Received: by 10.216.87.204 with SMTP id y54mr4805081wee.193.1271237920421; Wed, 14 Apr 2010 02:38:40 -0700 (PDT) Received: from [192.168.1.105] (82.158.50.35.dyn.user.ono.com [82.158.50.35]) by mx.google.com with ESMTPS id x1sm1231215wbx.13.2010.04.14.02.38.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Apr 2010 02:38:38 -0700 (PDT) Message-ID: <4BC58D10.4050609@lerdorf.com> Date: Wed, 14 Apr 2010 02:38:24 -0700 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10pre) Gecko/20100410 Shredder/3.0.5pre MIME-Version: 1.0 To: =?UTF-8?B?SsOpcsO0bWUgTG95ZXQ=?= CC: =?UTF-8?B?5ruV6Lev6YGl?= , internals@lists.php.net References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] One suggestion to PHP-FPM From: rasmus@lerdorf.com (Rasmus Lerdorf) On 04/14/2010 02:01 AM, Jérôme 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