I had a similar error, and I spun for about an hour.
The memory limit has been increased to 512m and there is still a problem. And I thought that was enough. So went looking elsewhere.
I cleared the caches with drush, still an error, and then looked at the database tables.
I noticed that all cache tables have been cleared, with the exception of cache_update. I truncated this table and bam, everything worked fine.
Before getting a memory limit error, I got max_input_vars error since I am in PHP5.4 . But this question and answer led me to this fix. Not quite sure how and why it worked, but it did.
source share