WordPress Problem : Fatal Error Memory Exhausted
![]() |
Have you ever experienced such problem in WordPress when trying to do a new post or doing other task :
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 8192 bytes) in /home/xxx/wp-includes/cache.php on line 363
I faced this problem for quite some times. Had searched for the solution and none of them helped. Most of them suggests to increase the default memory limit. Had tried to do it by following this post : Fix: WordPress Memory Exhausted Error – Increase PHP Memory but still it didn’t solve the problem.
Until I read one of the comment saying :
Just remember that if the problem is a memory leak (either in PHP itself or in some library that is used by a plugin), this will merely delay the occurence.
This gave me an idea to try deactivate the plugins one by one to see if it helps solve the problem. And voila… the problem solved after deactivating the Google XML Sitemaps plugin. After a long time searched and going through some hassles, the solution was only as simple as that.
So if you face the same problem, try to deactivate the plugins first. If it doesn’t help, try to increase your memory limit by following the guide from the link above. If you still get the error after that, then I suggest you contact your hosting provider and ask for their help.








Thanks for letting us know. I faced that problem as well a while back and I hardly managed to resolve it. You’re a real life-saver
[Reply]
I deactivated the plug ins and it worked! Appreciate a lot! I couldn’t figure out it myself!
[Reply]
What you need to do is go to your config.php file and add a single line of code just below your PHP statement:
So look for:
<?php
It’s at the top of the config.php file, you can’t miss it!
Then, drop down a line and add the following:
define('WP_MEMORY_LIMIT', '64M');
Save your config.php file and upload it again to your server, and you should find the problem is fixed.
What causes the error? Well it’s simply that the server doesn’t have enough memory allocated to perform all the tasks required by wordpress. It gets overloaded.
Where can I find the config.php file? You can find the config.php file in the root of your WordPress directory
[Reply]
I encounter this same problem also every time im going to post on WordPress. Thank’s for the solutions guys. !
[Reply]
Thanks Dunn, this article is really GREAT. I didn`t encounter this problem on my wordpress site but I would be very careful when adding any sitemap plugins in the future.
[Reply]
Hi My friends,
Greetings from India. A special and so many thanks to Dunn for providing this article on fixing the burning issue of WordPress memory usage. I was in lots of tension as well as doubt on how to fix it. My hosting support also failed to provide me a suitable solution on this. I’ve just added the piece code mentioned in Dunn’s post. And now I’m able to add new post in my blog. The ADD NEW POST function is now working without any hassle.
Again thanks a lot Dunn for your help. You’ve really DONE a good job for all WP users residing all over the world.
Advance X-mas greetings to you, your family and team and also to the fellow commentors of this post.
[Reply]
Hi Mosley,
Lots of thanks you too as you’re the sole person here to provide that piece of code to upgrade the WP Memory resource.
I’ve updated it with 256M and all of the function of my WP blog working fine.
[Reply]
Hi Dunn,
Thanks for this informative post 1
These problems need immediate solutions.Deactivating the plugins is a great idea to solve this problem.
Thanks again
Regards
[Reply]