• Every time I try to do my first scan with Wordfence I receive the following error message:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10560025 bytes) in…

    It seems to happen at “Scanning comments for URLs in Google’s Safe Browsing List”

    I have tried deleting my cache before doing the scan and still the same error. My host I believe already increased my memory in the past but I could ask again if there is a specific number I should request? What do you recommend I do, how can I get this to work?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter restalfep

    (@restalfep)

    Also if this helps, I have the following additional information:

    How much memory should Wordfence request when scanning: 256M

    Current maximum memory configured in php.ini: 256M
    Current memory usage: 11.25M
    Setting max memory to 90M.

    Congratulations, your web host allows you to use at least 80.25 megabytes of memory for each PHP process hosting your WordPress site.

    Thread Starter restalfep

    (@restalfep)

    As a quick update, our webhost increased our memory to 256M and that seems to have fixed the issue. The only concern is they are saying that by increasing from 128M to 256M then we probably need to upgrade our server from 2GB RAM to 6GB RAM. Does that make sense? Seems excessive for us to have to update our entire webhost plan for the Wordfence plugin to work.

    They said “With the current PHP memory limit of 256M multiplied by the number of simultaneous connections to apache/PHP (currently set at 20) means a maximum possible usage of 5.1G and there is only 1.7G available.” Not sure if 20 simultaneous connections is normal as that is a bit over my head but wanted to see your opinion.

    Thread Starter restalfep

    (@restalfep)

    Just following up, is there any answer to this?

    Hi @restalfep,
    Sorry for my late reply, I think your web host calculations are based on the “worst case scenario”, which means that “every” connection from these 20 will require the server to allocate the maximum memory allowed “256MB” which is not necessary at all (at least from the practical point of view), there are many tweaks that can be considered to optimize the performance of Apache web server and PHP before thinking about increasing the server physical memory.

    Thanks.

    Thread Starter restalfep

    (@restalfep)

    Thank you wfalaa for your help. That was my concern because of course the web host wants me to upgrade and pay more per month, which we can’t afford.

    So essentially if we change the maximum memory allowed to 256MB (so Wordfence can work properly) and have 2GB currently of physical ram on our server that still shouldn’t cause problems unless we have 8 connections all running simultaneously at 256MB (2.05 ram usage), which seems highly unlikely.

    Do you know what typically happens if the totaled server physical memory did ever accidentally get all used, does it crash the server? We just want to ensure our site cause issues for live users without us knowing.

    Thank you.

    It depends, if there is a process that tries to use a certain amount of memory that is not available then it will crash, also you may hear from users that your website is loading very slow (although it’s not necessary to be a server memory issue in this case), depending on your server OS/configuration you might get “OOM Killer” involved which will kill one or more processes to free up some memory and that may get your server down.

    There are many tools (you can search Google for “top”, “htop” memory monitor) for linux servers to watch your server memory usage through the terminal.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal Error – Memory – Can’t Scan’ is closed to new replies.