I have set my PHP MAMP server to a maximum of "256M" in the php.ini but am suddenly getting a memory error. There are two things that are strange about this:
The exact message I'm getting is this:
[25-Oct-2012 14:27:53] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 222300161 bytes) in [FILE_PATH]/wp-content/themes/lifegadget-pagelines/sections/lg_content/section.php on line 42
[25-Oct-2012 14:27:53] PHP Fatal error: Call to a member function get() on a non-object in [FILE_PATH]/wp-content/object-cache.php on line 52
So my questions are as follows:
Infinite loop can cause this or if you have circular references with pre 5.3 PHP version. See: Garbage collection
Inject this function ini_set('memory_limit', -1);
at the very beginning of your suspected memory leaking class/page, this is a temporary solution to get things working but it won't help you know where exactly your script is leaking memory.
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.