2

It is possible to know at what point the script reaches the peak memory?

I have a PHP script that at the end shows this result:

Usage: 380.515625Kb

Peak: 393.5859375Kb

Real: 512Kb

Script example:

<?php

...

echo PHP_EOL,
    'Usage: ', memory_get_usage() / 1024, 'Kb', PHP_EOL,
    'Peak: ',  memory_get_peak_usage() / 1024, 'Kb',  PHP_EOL,
    'Real: ',  memory_get_usage(true)  / 1024, 'Kb';
?>

The Peak is ~13kb greater than the Usage. It is possible to know which part of the code reached the peak of memory usage?

Community
  • 1
  • 1
Protomen
  • 9,471
  • 9
  • 57
  • 124
  • 1
    [This](http://stackoverflow.com/a/16682529/2518525) seems to do something like what you're asking – Darren Jun 02 '15 at 04:59

0 Answers0