Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24955 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95626 invoked by uid 1010); 25 Jul 2006 06:14:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95611 invoked from network); 25 Jul 2006 06:14:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2006 06:14:10 -0000 X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:35164] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id AA/DC-04178-0B6B5C44 for ; Tue, 25 Jul 2006 02:14:09 -0400 Received: (qmail 13718 invoked from network); 25 Jul 2006 06:13:05 -0000 Received: from internal.zend.office (HELO thinkpad) (10.1.1.1) by internal.zend.office with SMTP; 25 Jul 2006 06:13:05 -0000 To: "'Matt W'" , Cc: "Andi Gutmans" , "Ilia Alshanetsky" Date: Tue, 25 Jul 2006 10:13:48 +0400 Message-ID: <003701c6afb1$81b87720$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <00d601c6af9d$c18f2d30$0201a8c0@pc1> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Importance: Normal Subject: RE: [PHP-DEV] memory_get_usage with new Memory Manager From: dmitry@zend.com ("Dmitry Stogov") References: <00d601c6af9d$c18f2d30$0201a8c0@pc1> Right now memory_get[peak_]usage() show the amount of REAL memory that PHP (Zend Memory Manager) takes from system. Previous memory manager showed size of emalloc()-ed memory without malloc() overhead. Also it didn't consider internal caches. We need decide which behavior to use before 5.2.0 release. Thanks. Dmitry. > -----Original Message----- > From: Matt W [mailto:php_lists@realplain.com] > Sent: Tuesday, July 25, 2006 7:53 AM > To: internals@lists.php.net > Subject: [PHP-DEV] memory_get_usage with new Memory Manager > > > Hi, > > After looking through the new Memory Manager code, I assumed > this would be the case... (and just now got to test). Since > heap->size is only updated when a 256K or whatever block is > *actually* allocated/freed, the number returned by > memory_get_usage() will only be a multiple of that. That > doesn't make it very useful anymore if one is using it to see > how much memory usage differs by changing, say, number of > arrays/elements/variables, strings, etc. as I was last month > (small changes). And the example in the manual definitely > won't work as shown. > > Does anybody else think that memory_get[peak_]usage() should > work more like before? I would imagine it can be "fixed" > fairly easily, though it probably needs another variable, and > just a little extra overhead of inc./dec. that variable more > often (but I think that was done in the old MM anyway?). > > > Thanks, > Matt > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >