• Hello,

    I’ve been using Wordfence for a while now, and have not had a scan complete for a couple of months now. I’m running PHP 5.5 in WordPress 4.0. According to the PHP.ini settings on my host’s server, there is 128MB allocated. I have Wordfence set to request 120MB. I have had my host’s server guy verify that there is 128MB available, and there is.

    Here is the error I get EVERY time I try to complete a scan:
    Fatal error: Out of memory (allocated 35389440) (tried to allocate 73 bytes) in /homepages/7/d247834814/htdocs/wp-content/plugins/wordfence/lib/wordfenceHash.php on line 328

    Here is the output of the Wordfence memory tool:
    Fatal error: Out of memory (allocated 35389440) (tried to allocate 73 bytes) in /homepages/7/d247834814/htdocs/wp-content/plugins/wordfence/lib/wordfenceHash.php on line 328

    To me, that reads like there is an issue on line 328 in wordfenceHash.php, not actually an issue with the server’s memory allocation for PHP. Looking at line 328 the surrounding code in that routine in wordfenceHash.php, I wonder if the values aren’t getting reset for each file analyzed, causing this error to be thrown?

    I’m confused, because my server and its PHP settings are verified correct, but your plugin is throwing an error.

    https://wordpress.org/plugins/wordfence/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi

    Sorry you are having an error. I personally have all my Wordfence installs set to use 256mb of ram on the options page. I don’t remember what my php.ini files are right off but will check later. This is usually a limitation because of what the hoster has set the memory limit to. If your site also has plugins running, they too consume available memory, so its important to look at the whole picture.

    One of the things people have noticed is if they have a lot of image files (with big resolutions) and you have Wordfence set to scan them as executable, this can use a lot of memory. You might try turning that off to see if that fixes the error.

    let me know your list of plugins (let me know if you want to email that) and if turning off the scan images as if they were executable option helped.

    tim

    Thread Starter GMLGeek

    (@gmlgeek)

    Okay, I’ve upped the memory requested to 256MB, provider is giving me 512MB, I’ve added the memory_limit = “512M” to my php.ini, defined it in WordPress’ config file. I never had the ‘scan photos as executables’ checked. I’ve rebooted the server, even, to make sure the settings are loaded. I’m still getting this error: Fatal error: Out of memory (allocated 35389440) (tried to allocate 54 bytes) in /homepages/7/d247834814/htdocs/wp-content/plugins/wordfence/lib/wordfenceHash.php on line 328

    I love the security issues this plugin addresses, but I may just have to forgo the scans. The plugins I have:

    • Antispam Bee
    • Coming Soon
    • Contact Form Builder
    • Custom Facebook Feed
    • Disable Comments
    • Leaflet Maps Marker
    • MaxButtons
    • NextScripts: Social Networks Auto-Poster
    • Options Framework
    • Page Links To
    • Simple Full Screen Background Image
    • Smart Slider 2
    • TwitterBootstrap Image Slider
    • UpdraftPlus – Backup/Restore
    • Wordfence Security
    • WPFront Scroll Top
    • WP Twitter Feeds

    I really like the fact that the Chinese and Russians are being blocked by this….

    Thread Starter GMLGeek

    (@gmlgeek)

    I’ve mentioned that was one of my favorite features here before. I once blocked everything but the us for several days and redirected those people to google (to be fair that part was accidental lol)

    I’m not familiar with all those plugins so I can’t say definitively so its possible some of those are memory intensive, but nothing jumps out at me as a memory hog.

    Just to be clear, are you using the latest versions of wordfence and wordpress?

    tim

    Thread Starter GMLGeek

    (@gmlgeek)

    Yes, I’m on WordPress 4.0 and Wordfence 5.2.2. I should probably also mention that I’m using a child theme based on the GeneratePress theme, and it’s up-to-date as well. I try to stay on top of the updates as they usually fix some obscure security hole or bug.

    Sorry for the delay. I’m wondering, did you restart apache after you changed the memory limit in php.ini?
    You can test this by using the ling that says “Click to view your system’s configuration in a new window” Look for the line that says “memory_limit” under the section marked “core”

    Also you could edit the httpd.conf file to better handle memory overload. Here’s a good guide to that:
    https://thethemefoundry.com/blog/optimize-apache-wordpress/

    Let me know about the apache restart and the reported memory size.

    Thanks!

    tim

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Memory Allocation Error’ is closed to new replies.