問題描述
我偶爾會遇到服務器的內存分配限制,尤其是像 Wordpress 這樣臃腫的應用程序,但從未遇到過無法為池分配內存"和無法跟蹤任何信息的情況.
I've occasionally run up against a server's memory allocation limit, particularly with a bloated application like Wordpress, but never encountered "Unable to allocate memory for pool" and having trouble tracking down any information.
有人知道這是什么意思嗎?我試過增加 memory_limit
沒有成功.我也沒有對應用程序進行任何重大更改.一天沒有問題,第二天我就遇到了這個錯誤.
Does anyone know what this means? I've tried increasing the memory_limit
without success. I also haven't made any significant changes to the application. One day there was no problem, the next day I hit this error.
推薦答案
可能與 APC 相關.
對于遇到此問題的人,請指定您的 .ini 設置.特別是您的 apc.mmap_file_mask 設置.
For the people having this problem, please specify you .ini settings. Specifically your apc.mmap_file_mask setting.
對于文件支持的 mmap,它應該設置為:
For file-backed mmap, it should be set to something like:
apc.mmap_file_mask=/tmp/apc.XXXXXX
要直接從/dev/zero 映射,請使用:
To mmap directly from /dev/zero, use:
apc.mmap_file_mask=/dev/zero
對于符合 POSIX 的共享內存支持的 mmap,請使用:
For POSIX-compliant shared-memory-backed mmap, use:
apc.mmap_file_mask=/apc.shm.XXXXXX
這篇關于是什么導致“無法為池分配內存"?在 PHP 中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!