"Out of memory (allocated 248512512)" error in wp-db.php

0

Someone knows which error would be related to this wordpress message.

Fatal error: Out of memory (allocated 248512512) (tried to allocate 17498497 bytes) in /backup/public_html/wp-includes/wp-db.php on line 1094

I am not able to install plugins, it activates the ones I have installed and when I try to update some article I also get this message.

On line 1094 there is this code

      /**
 * Real escape, using mysqli_real_escape_string() or mysql_real_escape_string()
 *
 * @see mysqli_real_escape_string()
 * @see mysql_real_escape_string()
 * @since 2.8.0
 * @access private
 *
 * @param  string $string to escape
 * @return string escaped
 */
function _real_escape( $string ) {
    if ( $this->dbh ) {
        if ( $this->use_mysqli ) {
            return mysqli_real_escape_string( $this->dbh, $string );
        } else {
            return mysql_real_escape_string( $string, $this->dbh );
        }
    }

    $class = get_class( $this );
    if ( function_exists( '__' ) ) {
        _doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), E_USER_NOTICE );
    } else {
        _doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), E_USER_NOTICE );
    }
    return addslashes( $string );
}
    
asked by anonymous 07.09.2015 / 02:07

1 answer

1

Hello, 256MB is a lot of memory for a script, so if you are overdoing, the first things to check are there are some scenarios: An infinite loop that is cutting its memory limit. Another thing ... if you are pulling the data from a database and unintentionally pulling it from a table with a lot of data. This may drain your memory. Among other things... How to get rid of this message ?! Modify your php.ini to increase your memory_limit to something greater than what you currently have for - 512MB. But this will solve your problem partially, probably in the future you may have another problem of this, so I advise you to try to find what can this problem give you, blz? I hope I was helpfull. See you later.

    
08.09.2015 / 05:20