Delicious Brains


Memory Issues

There are two ways to combat issues related to low memory, reduce the memory being used or increase the memory that can be used.

Maximum Request Size

WP Migrate DB Pro tries to be conservative when it comes to memory consumption. We recently changed the default request size to 1024 kB, meaning that our plugin should be consuming roughly that amount for the data being transferred during the migration process. However, WordPress core, your theme, and other plugins will also be consuming memory and can really add up.

It’s possible that you’ll run into memory consumption errors during the migration process if your server’s memory limit is low. This is particularly true with shared hosting. If this happens you can try lowering the “Maximum Request Size” using the slider control on the Settings tab of the WP Migrate DB Pro plugin page. The minimum size is 512 kB.

Compatibility Mode

We recommend using WP Migrate DB Pro’s Compatibility Mode to decrease the memory consumption of other plugins during migrations.

WordPress Memory Limit

Otherwise you can attempt to increase the memory limit for WordPress and potentially PHP in general.

WordPress has a default memory limit of 40Mb, you can increase this with a define in your wp-config.php file. Edit your WordPress install’s wp-config.php file and enter the following just above the /* That's all, stop editing! Happy blogging. */ comment:

define('WP_MEMORY_LIMIT', '128M');

Be careful to enter the value in quotes and to use “M” rather than “Mb” for megabytes otherwise it will not work.

You can also have a separate memory limit for processes running in the Administration area of WordPress:

define('WP_MAX_MEMORY_LIMIT', '128M');

This is useful if you would like to keep the memory limit for general users of your site contained but increase it for the admin users.

PHP Memory Limit

It’s possible that PHP has been set up with a low memory_limit which restricts how much you can give to WordPress. If you are able to edit your php.ini file you can increase it there. Find the entry in your php.ini that is similar to the following and update it to something larger than your desired WordPress memory limit and then restart your web server:

memory_limit = 256M ; Maximum amount of memory a script may consume (8MB)

If you are unable to edit your php.ini file, then you can enter something similar to the following into your .htaccess file for your WordPress install:

php_value memory_limit 256M

If you are unable to edit your .htaccess file or it does not seem to work, please talk to your hosting provider.

Some Memory Limit Recommendations From Other Plugins

WooThemes recommends 96M for WooCommerce.