• Resolved sankari

    (@sankari)


    Hi,

    One of my customer’s websites is broken. Instead, there is this error message appearing:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8388608 bytes) in /home/[client]/www/wp-content/plugins/ip-geo-block/classes/class-ip-geo-block-logs.php on line 483

    How to solve this kind of issue?
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi @sankari,

    Sorry about your customer’s issue, but I think that’s not this plugin’s issue. The memory size error will happens when so many plugins are installed for example.

    Technically, the line 483 of class-ip-geo-block-logs.php is as follows:

    if ( FALSE !== ( $files = scandir( $dir = get_temp_dir(), 1 ) ) ) {

    The function get_temp_dir() is a basic WordPress function and scandir is an ordinary PHP function.

    And the line 483 is for “Live update” on dashboard. Then your customer has to increase the memory limit for admin.

    So please try to define the following lines in wp-config.php with proper memory size. For example:

    define('WP_MEMORY_LIMIT', '512M');
    define('WP_MAX_MEMORY_LIMIT', '512M');

    512M is just an example.

    You can find the document about those symbols at Increasing memory allocated to PHP in Codex.

    Plugin Author tokkonopapa

    (@tokkonopapa)

    By the way, this plugin would not eat so many memory. For example, before this plugin is activated, Query Monitor says about 23.45M bytes:

    After this plugin is activated:

    The difference is 1M bytes on admin dashboard. Of course, this result may not show the exact memory size which this plugin is needed. But the error message you reported said that WP needs just 8M Bytes (8388608). So please consider to increase the memory size at least more than 8M bytes.

    • This reply was modified 6 years, 6 months ago by tokkonopapa.
    Thread Starter sankari

    (@sankari)

    @tokkonopapa Thanks very much for your fast response and your guidance. I increased the memory size and now the site works like a charm. It’s good we covered this issue now as a reference for those who might run into the same thing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error: Allowed memory size of [x] bytes exhausted’ is closed to new replies.