RE: [PHP-DEV] memory_get_usage with new Memory Manager
| From: | Dmitry Stogov | Date: | Tue, 25 Jul 2006 06:13:48 +0000 |
| Subject: | RE: [PHP-DEV] memory_get_usage with new Memory Manager | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24955@lists.php.net to get a copy of this message | ||
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
>
>