Tired of Seeing ‘Fatal Error Allowed Memory Size Exhausted’? Here Are 3 Ways To Fix It

by

7-layers of Security for Your WordPress Site

Your website needs the most comprehensive security to protect it from the constant attacks it faces everyday.

fatal error allowed memory size exhausted

Seeing the fatal error allowed memory size exhausted message pop up on your WordPress site can be really upsetting. You have maintenance tasks to complete but this tech issue brings everything to a halt.

It can feel like you are drowning in technical gobbledygook, struggling to make sense of what went wrong.

Don’t worry; solving this problem can be easier than it looks. Our easy guide offers reliable solutions to help you tackle this issue without any delay.

TL;DR: The allowed memory size exhausted error means your WordPress site has exceeded its memory limit, often due to plugins or large tasks. Fix this by increasing the memory limit in your site’s settings and managing resources efficiently.

What does fatal error allowed memory size exhausted mean?

When you see fatal error allowed memory size exhausted on your WordPress site, it’s your website’s way of saying, “I’ve run out of room to work!” 

Your site needs some memory space to handle tasks like processing data, running any extra features you added (plugins), and showing your web pages to visitors.

This error shows up when your site tries to use more memory than it’s currently allowed—imagine trying to fit too many clothes into a small suitcase. When it runs out of space, your site can’t function smoothly.

This often happens if you use heavy plugins, have too many things running at once, or try to do big tasks like updates, installing new features, or uploading large files.

But don’t worry, it doesn’t mean your site has crashed. It just needs a bit more room to handle its chores. As your site expands with more content or gets more visitors, the current memory limit might not be enough. 

Many hosting plans start with a basic memory limit, and sometimes you need to increase this to match your site’s growing needs.

How to fix the “allowed memory size exhausted” error

Getting hit with the “allowed memory size exhausted” error can be annoying, but you can sort it out with a few simple steps. Here’s how:

A) Edit the wp-config.php file

  1. Get access to your site files: You need to look at your website’s files. Use something like a file manager plugin or an FTP tool like FileZilla to do this. 

Tip: Take a backup of your site first! A tiny mistake while editing core files while troubleshooting could lead to a site that is down.

  1. Find and edit the wp-config.php file: This file is in your main WordPress folder, often called public_html or www. Just before the line that says “That’s all, stop editing! Happy blogging.” add this line of code:
Filezilla wp-config.php file edit
define('WP_MEMORY_LIMIT', '256M');

Why 256MB? Your site usually starts with a default memory limit, often set at 32MB by your hosting provider. Bumping it up to 256MB gives your site more room to work smoothly.

  1. Save the changes: If you’re using FileZilla, save directly. If not, you might need to upload the updated file manually and replace the old one. Check your site to see if the error is gone.

B) Modify the php.ini file

  1. Find the php.ini file: Access your hosting control panel or use FTP to locate the php.ini file.
  1. Edit the file: Look for the line that says `memory_limit` and change it to this:
memory_limit = 256M;
  1. Save the file and upload it: Once you’ve increased the memory limit, save the file and upload it back to your server’s main folder. Verify your site to see if the error is cleared up.

C) Disable plugins

If your site still shows the error after trying these fixes, it might mean a certain plugin is taking up too much memory.

  1. Head to Plugins: Log into your WordPress dashboard and head to the Plugins section.
  1. Deactivate all plugins: Turn off all the plugins at once to see if the error disappears. If it does, try switching them back on one by one to find the culprit.
Disable plugins via wp admin dashboard

If you can’t access your dashboard, use FTP:

  1. Access your files: go to the wp-content directory within your main folder, public_html, or www.
  2. Rename the plugins folder: Change the plugins folder name to something like plugins-deactivated. This will turn off all your plugins.
rename plugins

If the error is gone, rename the plugins folder back to plugins. Then, rename individual plugin folders to pluginname_deact to deactivate them one at a time. Reactivate each plugin to see which one is causing the issue.

Best practices for memory management

Keeping your website running smoothly is important, and managing its memory is a big part of that. Here are some simple tips to help:

Watch your memory usage: Just like checking how much storage is left on your phone, keep an eye on your website’s memory to catch problems early.

Monitor memory usage

Stay updated: Regularly update your WordPress, plugins, and themes. These updates often fix bugs and boost performance.

WordPress MalCare updates

Use only necessary plugins: Limit the number of active plugins, as having too many can slow down your site.

Choose lightweight themes and plugins: Opt for options that don’t consume too much memory to help your site load faster.

Use a caching plugin: Caching plugins store copies of your pages, helping them load more quickly for visitors.

Optimize your images: Make sure images aren’t too large. Smaller images load faster and reduce strain on your server.

Think about upgrading your hosting plan: As your site grows, consider a better hosting plan or a better web host to handle the increased activity.

Clean up your database: Regularly remove old and unnecessary data to keep your site running efficiently.

Check your site’s performance: Run tests to find any slow areas or potential issues before they become problems.

Parting thoughts

Dealing with the “allowed memory size exhausted” error becomes much simpler once you know the right steps. 

By regularly checking and adjusting your site’s memory settings, you can prevent these exhaustion errors from happening. As your site grows, ensure that your server is equipped to handle the increased activity.

FAQs

How do I fix fatal error allowed memory size?  

To resolve the fatal error allowed memory size issue, you need to increase the memory limit of your WordPress site. You can do this by editing the wp-config.php file and adding the line: define(‘WP_MEMORY_LIMIT’, ‘256M’);. This allows your site to handle more data and processes efficiently.

What is the fatal error allowed memory size of 134217728 bytes exhausted in PHP?  

This error indicates that PHP has reached its memory limit of about 128MB, preventing it from processing additional data. It usually happens with tasks that consume a lot of resources. You can resolve it by raising the memory limit in the php.ini or wp-config.php files.

How can I fix fatal error?  

To fix a fatal error, first identify the type of error. It typically relates to memory limits or software conflicts. You can increase memory limits in your site’s settings or resolve conflicts by deactivating plugins or themes, and then reactivating them one by one to pinpoint the issue.

Why do I get fatal error?  

Fatal errors occur when your website runs into an issue it can’t solve, often due to memory constraints or incompatible plugins/themes. They halt processes to prevent further problems. Adjusting memory settings or resolving software conflicts usually fixes these errors.

What is memory fatal error?  

A memory fatal error happens when your site tries to use more memory than it has available, causing processes to stop. This often occurs during tasks that require large data processing. Increasing the memory allocation in your server or site settings generally resolves this issue.

Category:

You may also like


How to Whitelist an IP Address in WordPress
How to Whitelist an IP Address in WordPress

Whitelisting IP addresses is a manual way to ensure that certain IPs have access to your WordPress website. Ideally, you’d want your WordPress firewall to take care of that hassle…

5 Best WordPress Firewalls to Block Attacks
5 Best WordPress Firewalls to Block Attacks

To keep your WordPress site secure from hackers, prevention is key. Fixing a hacked site can take a lot of time, effort, and money. Hacks can also cause your site…

How can we help you?

If you’re worried that your website has been hacked, MalCare can help you quickly fix the issue and secure your site to prevent future hacks.

My site is hacked – Help me clean it

Clean your site with MalCare’s AntiVirus solution within minutes. It will remove all malware from your complete site. Guaranteed.

Secure my WordPress Site from hackers

MalCare’s 7-Layer Security Offers Complete Protection for Your Website. 300,000+ Websites Trust MalCare for Total Defence from Attacks.