Error while upgrading WordPress – Fatal error: Out of memory

Solution:

The only thing you could do is try and uninstall the old WordPress 3.1. Then, download WordPress 3.2.2 from the website and install the new version.