How to debug "Fatal error: Allowed memory size of xxx bytes exhausted" in PHP

Viewed 4707

What is the best strategy to debug a "Fatal error: Allowed memory size of 268435456 bytes exhausted " error? This error i'm getting is strange and something is obviously wrong. The function which is causing it is

/**
 * Flush all output buffers for PHP 5.2.
 *
 * Make sure all output buffers are flushed before our singletons our destroyed.
 *
 * @since 2.2.0
 */
function wp_ob_end_flush_all() {
    $levels = ob_get_level();
    for ($i=0; $i<$levels; $i++)
        ob_end_flush();
}

i simply rebased some code i was working on and started getting this. what's your strategy to debug this?

4 Answers

In my case, it was because Easyphp was trying to load a too large error.log file. Deleting the server log file in eds-binaries\httpserver\apache2418x160331124251\logs helped me solve the problem.

Related