if i set memory_limit开发者_如何学运维 is 128MB. I run a index.php:
<?php
echo 1;
?>
then this script use 128MB RAM ? I think it is not , but want make sure it.
No it doesn't. 128 MB is just the maximum a script can use, it doesn't necessarily HAVE TO use 128 MB. But it won't be allowed to use anymore than that.
From the docs (emphasis mine):
This sets the maximum amount of memory in bytes that a script is allowed to allocate.
精彩评论