Is it possible to know at what point the script reaches peak memory?
I have a PHP script that in the end shows this result:
Use: 380.515625Kb
Peak: 393.5859375Kb
Real: 512Kb
Example:
<?php
...
echo PHP_EOL,
'Uso: ', memory_get_usage() / 1024, 'Kb', PHP_EOL,
'Pico: ', memory_get_peak_usage() / 1024, 'Kb', PHP_EOL,
'Real: ', memory_get_usage(true) / 1024, 'Kb';
?>
The Peak is ~ 13kb greater than the Usage . Is it possible to know where in the code the script has reached the peak of memory usage?