Increasing Memory Limits in WordPress
Posted on September 30th, 2010 by Chris in Guides, tags: How to, memory, php, WordPressWe know this has nothing to do with saunas, but its occupied much of our time for the last few weeks, and has caused a few days of downtime here. You may be experiencing similar problems, so we’d thought we’d share this.
This site is powered by WordPress. Since upgrading to the current version (3.0.1) we’ve had issues with memory. Specifically, we’ve been getting errors “Allowed memory size of 33554433 bytes exhausted.” We first started seeing them on the admin dashboard, then on some of the other admin pages, then on a few of the public pages. Then it took down the whole site one weekend.
Anyway, we’ve spent a lot of time digging through the WordPress support forums, enabling and disabling plugins, and generally banging our heads against the wall. We finally found it.
Here is our solution:
- Upgrade WordPress and all your plugins to the current version first. Disable any you can’t live without. To get this site back online, we had to ftp in and delete a few non-critical plugins that were way out of date.
- Install and activate the TPC! Memory Usage plugin by Webjawns. This makes the troubleshooting process easier.
- On the Memory Usage Overview that TPC puts at the bottom of your admin dashboard, look at the WP Memory Limit and the PHP Memory Limit. Both of these were set to “32M” on this site. Since version 2.8, WordPress really wants 64M. Memory usage was at more than 90% (WordPress wanted to use more, but couldn’t. This was the cause of the errors.)
- To increase the WP Memory Limit, edit your wp-config.php file and search for a line like this and make sure the number before the last ‘M’ is 64 (or 128):
define(’WP_MEMORY_LIMIT’, ’64M’);
If you can’t find it, add it up near the other define statements towards the top of the file. - To increase your PHP Memory limit (you have to do both), you need to edit or add a php.ini file. On our host (PolurNet), we had to create it in the wp-admin directory. We tried other locations first, and it didn’t work. Ours has only this line:
memory_limit = 64M
Where this php.ini file has to reside and if you can edit it varies from host to host. You’ll need to speak with your hosing company’s tech support for exact instructions. - Go back and re-install or re-enable your plugins. Watch to see if any of them are especially large memory hogs as you do so.
All right. Time to take off the propeller beanie and get back to the sauna.









Entries (RSS)