http://php.net/manual/de/function.memory-get-peak-usage.php
point out that by default the value from emalloc()
(memory manager written in c++) will be returned.
In what cases should I use true
as parameter?
As far as my understanding goes here is the answer:
memory_get_peak_usage(true)
when you need to find out the WHOLE usage of your app, including all kinds of overheads and etc. It's handy when you want to find out how heavy your app is. true
usually rounds up numbers to the bigger size, because you can't just allocate 729 KiloBytes from RAM, your app takes whole 1024 KiloBytes.
memory_get_peak_usage()
is handy when you want to find out which 'method' of execution is most lightweight, so you can cram as much actions as possible into the 1024 KiloBytes that are already allocated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With