Re: Trying to find out where the memory went
| From: | Mike van Riel | Date: | Tue, 07 Jun 2011 18:26:50 +0000 |
| Subject: | Re: Trying to find out where the memory went | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53172@lists.php.net to get a copy of this message | ||
Am i then also correct to assume that the output of
memory_get_peak_usage is used for determining the memory_limit?
Also: after correcting with your new information (zval = 114 bytes
instead of 68) I still have a rather large offset:
640952+2165950+114+(276697*114)+(276697*3*114)+2165950 = 131146798 =
125M
(not trying to be picky here; I just don't understand)
_If_ my calculations are correct then a zval should be approx 216 bytes
(excluding string contents):
((244000000-640952-2165950-2165950) / 4) / 276697 = 215.9647B
Mike
On Tue, 2011-06-07 at 19:50 +0200, David Zülke wrote:
> memory_get_peak_usage() is the maximum amount of memory used by the VM of PHP (but not by some
> extensions for instance) up until the point where that function is called. So the actual memory
> usage may be even higher IIRC. But yeah, you're basically right. I've explained in another
> message why it might be so much more than you expected (zval overhead, basically)
>
> David