We were having trouble with a site’s memory limits. We had a dozen or so plugins running, but nothing out of the ordinary, and we kept hitting memory limits. Even on the WordPress Dashboard, the Incoming Links and the RSS Feed had the same “Allowed memory size of xxxxxx bytes exhausted.” Even more important, we couldn’t install new plugins or upgrade WordPress. I’ve been around the block trying to increase memory for the NextGen gallery, but this was just everywhere.

Here’s a quick link to the solution.

I did the usual fixes, as far as you can do on shared or reseller hosting. I even found a really cool plugin called TPC! Memory Usage that showed me what the PHP memory usage was on the server. Pretty graph that went from green to yellow to red as I added more plugins. I deactivated all plugins and then activated them one by one. Pretty soon I was at 96% of resources. The technical sysadmin in me said, “Hmm, that seems like a lot.”

wp-config.php

Add this code to your wp-config.php file:

[code]define(‘WP_MEMORY_LIMIT’, ’64M’);[/code]

That didn’t help.

php.ini

Another solution suggests adding the following code to your php.ini file in your root directory (usually public_html or where WordPress files are):

[code]memory_limit = 64M[/code]

No dice.

install.php

Yet another suggestion says to edit the install.php file WordPress’ /wp-admin/ directory:

[code]ini_set(‘memory_limit’,’32M’);[/code]

Ay dios mio!

wp-settings.php

Might as well try this one.

Change “define(‘WP_MEMORY_LIMIT’, ’32M’);” to “define(‘WP_MEMORY_LIMIT’, ’64M’);”

.htaccess

While we’re at it, we could try the old .htaccess file.

[code]php_value memory_limit 64M[/code]

As you can guess, we were getting nowhere. These all seemed like bandaid solutions to me. We were trying to “trick” the server into using, or allocating, more memory than it was supposed to. I’m no sysadmin, but it seemed like we weren’t getting at the root of the matter. Or as Steve Martin said, “Hey, maybe it’s the needle.”

The Solution: Switch Hosts

 

The site was on a host that I’ve been using for years. It’s always been just fine. But recently I’ve set up a reseller account at HostGator and I’ve noticed speed improvements, better uptime, and it just seems zippier. So I moved the site from one host to the other.

Hmm. This is what I saw using the TPC! Memory Usage plugin. We went from 96% to 7% memory being used. Notice that the Incoming Links box is working again as well as the RSS Feed. OK, so the simple assumption is that we get more memory allocated at HostGator, right? But if each site gets more memory, won’t the server crash under the strain? Well, this is where my techno knowledge ends.

Is the site now faster. Yep. Are we using less memory of the total memory. Yes. Can we see the widgets on the Dashboard. Yep. Install plugins. Uhuh. Upgrade WordPress. Affirmative. Yowza.

We love you HostGator!