"Cannot allocate memory" when upgrading

Just 2gb swap file is needed, it will mostly be used only during upgrades. If you have 4gb or more ram you may not need the swapfile.