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:[EMAIL PROTECTED] > 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 > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php