I got that problem trying to build Code::Blocks under Linux once but I'mn't sure yet if it has to do directly with RAM, HDD space or both (I gave it too few resources to that virtual machine).
If you try again with 3.4.5 could you share how many MiB of RAM it used before failing, and of course how many RAM you have?