Hi,
Unless the host has a hard limit set on memory usage, you may be able to increase “How much memory should Wordfence request when scanning” near the bottom of the Wordfence options page, to prevent the memory error.
If you use a caching plugin, you could add the path to the cache in the Wordfence option, “Exclude files from scan that match these wildcard patterns. (One per line)”, so the cache files won’t be scanned. It’s not ideal, but it’s less common to see the cache infected — you could also periodically remove this exclusion, clear the cache, and then manually run a scan, to make sure those folders are at least checked sometimes.
If you are using either of these options, it’s usually ok to disable them unless you’re cleaning a site that has already been hacked:
Scan images and binary files as if they were executable
Enable HIGH SENSITIVITY scanning. May give false positives.
Most hosts we’ve seen will increase the memory limit or execution time, but if your host(s) won’t adjust their restrictions, you might need to turn off some of the other options under “Scans to Include” — we don’t normally recommend this since it decreases security, but if the host has aggressive limits, it might be the only option.
-Matt R