You may have already experienced it: You are working on your WordPress site and suddenly this nasty message pops up:
Fatal error: allowed memory size of 40102864 bytes exhausted or Fatal error: out of memory.
It's simple: The WordPress memory limit has either been reached, the PHP memory limit is full, or the entire memory of your package is in use.
We should take a closer look at this from time to time.
The default WordPress memory limit is 40 MB. Here is the plan:
<?php
, write the following:define( 'WP_MEMORY_LIMIT', '256M' );
Replace the 256M simply by the amount of RAM you need.
Our default PHP memory limit is 256 MBHere's how you can customize it:
memory_limit = 512M
You can also 512M adjust as needed.
If you still see error messages after following the steps above, it might be because your package simply doesn't have enough memory.
Here's what you can do:
The WordPress Memory Limit is the maximum amount of memory that WordPress can use for its operations.
You will see error messages like “Fatal error: allowed memory size exhausted”.
Yes, but make sure your hosting package provides enough resources.
If you follow these steps, you will increase the WordPress memory limit and finally put your memory problems behind you!
Lucas says:
Questions? Feel free to ask!