memory_limit¶
memory_limit is the directive that caps the maximum amount of memory that PHP can use.
The limit is expressed in bytes, although options are available for kb K, Mb M and Gb G, case insensitive.
The limit may be lifted by setting this directive to -1.
PHP requires a minimum of memory when starting. Usually, it is about 2Mb of RAM. Setting any positive value for memory_limit below that threshold prevents PHP from starting.
The default value of memory_limit is 128 Mb.
memory_limit may be changed during execution with ini_set().
<?php
echo ini_get('memory_limit'); //128M
?>
See also PHP memory_limit – understanding and increasing.
Related : Memory, php://memory, php://tmp, Vertical Scaling