开发者

if memory_limit is 128M , then any script will use 128MB RAM?

开发者 https://www.devze.com 2023-03-04 06:36 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消