This error can occur for multiple reasons. In my case, it occured when trying to edit an already existing drupal page. I would attempt to edit the page, and Drupal would respond with this:
What we need to do is increase the allowed memory size for php scripts. This is easy assuming that you know the location of your php.ini file (if you don’t, read Fix 2).
Inside this file, find the following line and make the following changes:
Note: You might have to increase the number depending on how many modules your Drupal installation is using.
If you cannot find your php.ini file, either it does not exist yet, or your host won’t allow you to access it. We will assume that the file does not exist yet, so lets create it.
Save the following code into a file named php.ini:
Put this file in your Drupal website root folder, …/public_html/.
Your memory error should no longer occur after this fix, however considering there are many reasons for this error to occur it might also not work.