memory_get_usage with new Memory Manager
| From: | Matt W | Date: | Tue, 25 Jul 2006 03:52:31 +0000 |
| Subject: | memory_get_usage with new Memory Manager | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-24954@lists.php.net to get a copy of this message | ||
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