Memory limit is the maximum amount of RAM that a single run of a PHP script may use. It protects the server from one faulty or demanding application using up the memory for everyone.
Which limit you have
| 512 MB | the standard value, enough for most websites, including WordPress with common plugins |
| 1024 MB | for more demanding applications and large imports |
| 2048 MB | for very demanding applications, for example large online stores or bulk operations |
We will set a higher value on request, just contact us.
How to tell the limit is not enough
The application ends with an error that looks like this:
Fatal error: Allowed memory size of 536870912 bytes exhausted
The number in the message is the limit in bytes. 536870912 bytes equals 512 MB, 1073741824 equals 1024 MB and 2147483648 equals 2048 MB. Other symptoms are a white screen, a 500 error, or an interrupted import or file generation.
Before you raise the limit
Running out of memory is often a symptom of another problem. Check these things:
- What was happening when the error occurred: a product import, image generation, a plugin backup?
- Was it caused by a newly installed plugin or an update? Try disabling it.
- Is the script needlessly processing too much data at once (huge images, a whole file held in memory)?
- For large imports, try processing the data in parts.
WordPress has its own limit
WordPress also sets its own limit, which cannot exceed the PHP limit. You can raise it in the wp-config.php file:
define( 'WP_MEMORY_LIMIT', '256M' );
Insert the line above the line containing the text “That's all, stop editing”. There is no point in setting a value higher than the PHP memory limit.