memory_get_peak_usage

Returns the peak of memory allocated by PHP

Syntax

memory_get_peak_usage(bool $real_usage = false): int

Parameters

real_usage

Set this to true to get the real size of memory allocated from system. If not set or false only the memory used by emalloc() is reported.

Return

Returns the memory peak in bytes.

Examples

1 · void

<?

$return = memory_get_peak_usage();

echo $return;

?>
443976

2 · real_usage

<?

$real_usage = true;

$return = memory_get_peak_usage($real_usage);

echo $return;

?>
2097152
HomeMenu