Case Study: Finding Out How Much Memory Is Available to WordPress

A number of projects we work on as part of our WordPress Technical Support service we find that there is not enough memory to run WordPress correctly.  Your site will display out of memory errors and stop working correctly.

Hosting Companies Are Mean By Default

It has been my experience that hosting companies will be mean with their memory allocation by default.  It is not uncommon for hosting companies to give you 32mb of memory.

This may be fine for a static site, but throw in a couple of complex plugins and your site will very quickly run out of memory.

Testing Memory Limit

The quickest way to test your memory limit is to run the PHP command phpinfo().  Please click on the link to download a zipped copy of phpinfo.php which will run the command for you.

Download phpinfo.zip>>

Upload the unzipped php file to the root of your site and run http://yourdomain.com/phpinfo.php.  You will see a screen filled with various PHP config variables, the one we are looking for is memory_limit.  You will see your current memory value, as you can see from my example, it is 32M (32 megabytes).

NB: This exposes a lot of your site config information which could be useful to a hacker so delete this file once you’re done.

Increasing Memory

This will really depend upon your hosting company, but many allow you to edit the memory value, look for a file called php.ini on your site, edit and increase the memory_limit to 48 or 64M and see if that stop your out of memory issues.

If you are not happy editing your config files I would refer this to your hosting company, the majority are more than happy to help you do this.

Image by brainblogger

Leave a Reply

Your email address will not be published. Required fields are marked *