简体   繁体   中英

Use ini_set(“memory_limit”, …) without memory allocation

我如何在PHP中使用ini_set("memory_limit","some_number")只为该php进程设置最大内存限制,而不分配该内存?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM