Home > PHP > Function > PHP Options/Info > memory_get_usage()

memory_get_usage()

memory_get_usage - Returns the amount of memory allocated to PHP

Syntax

int memory_get_usage (bool $real_usage)

Arguments

  • 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.

Description

Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.

Version

PHP 4.3.2, 5

Return value

Returns the memory amount in bytes.