The reason behind this error is that you exceed the default Memory Limit provided by your web host.

To fix this you will need to locate wp-config.phpfile, which can be found at the root of your wordpress installation.

Then add the following line inside the main php tag:

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

This will increase the memory limit to 96M so this should fix the problem for you by adding more memory. If you still get the error even after applying this fix then most likely you will need to increase the memory limit directly from your php.ini.

To increase the memory limit from your php.ini file you will need to locate your php.ini file on your server

open the php.ini file in a text editor.
Search for memory_limit.
Increase the memory limit for your php applications.

If your on a shared host and can’t find php.ini then you will need to contact your web host. They would have to go in their php.ini file and increase the memory limit for you.