开发者

Use ini_set("memory_limit", ...) without memory allocation

开发者 https://www.devze.com 2023-01-24 20:11 出处:网络
How I can use ini_set(\"memory_limit\",\"some_number\") in PHP to only set maximum memory limit for that php p开发者_如何学Crocess, not allocate that memory?I don\'t think there\'s a need to prevent a

How I can use ini_set("memory_limit","some_number") in PHP to only set maximum memory limit for that php p开发者_如何学Crocess, not allocate that memory?


I don't think there's a need to prevent allocation of the memory.

Even if the PHP interpreter would start out with a big malloc() (which I doubt) then still the memory is only really allocated as soon as the process starts using it.

A related phenomenon is called overcommitment, there's a few good topics about it here on SO.


something good to read Memory Management with PHP

http://www.informit.com/articles/article.aspx?p=516587

If you explain more about your situation and what you exactly need, then may be more answers you can expect

0

精彩评论

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

关注公众号