What an allowed memory size exhausted error means
A message such as "Fatal error: Allowed memory size of 134217728 bytes exhausted" means PHP reached its memory ceiling while processing the request. The byte figure is the configured limit at the point of failure. For example, 134217728 bytes is 128 MB.
PHP uses memory_limit to restrict how much memory one script can allocate. WordPress can also request its own memory allowance with WP_MEMORY_LIMIT, but the server's PHP configuration can still impose the effective ceiling. This is why changing only WordPress settings does not always change the value reported in the error.
Common causes of WordPress memory exhaustion
Memory use often rises during image processing, large imports, backups, page builder operations, complex database queries and ecommerce administration. A plugin can also enter an inefficient loop, load a large data set into memory or conflict with another extension. In those cases, increasing the limit may hide the symptom without fixing the underlying fault.
Recent changes matter. If the error started after installing or updating one plugin, changing the theme, importing data or upgrading PHP, test that change first. The file path in the fatal error is useful evidence, but remember that the file named at the point of failure is not always the component that consumed most of the memory.
How to fix a WordPress memory limit error safely
Before editing files or the database, take a full backup of both website files and the database. Then confirm the failing action and change one thing at a time.
- Retry the exact action once and note whether the error is repeatable. Check the fatal error path and any recent plugin or theme changes.
- Temporarily disable the suspected plugin if the error began after an update or installation. If the failure disappears, investigate that plugin before increasing limits globally.
- Check the PHP memory limit in your hosting control panel or PHP configuration. PHP documents memory_limit as the per script allocation limit.
- If the server allows it and the site genuinely needs more memory, WordPress can request a higher amount in wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );Use a value supported by your host rather than assuming that a larger number is always better. If you manage the server, the corresponding PHP setting is normally in php.ini, for example:
memory_limit = 256MAfter the site is stable, repeat the original task and monitor memory related errors. If consumption keeps climbing, profile or replace the code responsible rather than repeatedly increasing the ceiling.
When to get help with PHP memory exhaustion
Stop if memory errors affect checkout, scheduled jobs or multiple unrelated pages, if the site needs unusually large limits for ordinary requests, or if the reported file is custom code you cannot safely change. Also stop if hosting limits prevent the required setting from taking effect.
Web Support Services offers an Emergency Fix for £249 per incident, with a response within 2 working hours. For ongoing maintenance, backups and monitoring, care plans start from £59 a month.