What are the potential problems that开发者_如何转开发 could be encountered when the memory limit in php.ini is set to say 100MB?
I can see only the obvious one: That a greedy or broken script can hog a lot of your resources. If such a script gets requested by multiple clients simultaneously, it could become a serious resource problem for your server.
Depending on your use case, maybe it's wise to increase the memory limit on a per-script basis instead.
On Linux, if the server runs out of memory, it starts swapping (using slow hard disk for virtual memory).
If it runs out of swap, it starts killing processes at semi-random (the algorithms are complex and usually hard to predict).
精彩评论