Indeed, if you have a system with 8GB of ram you're only able to access ~3.5GB of it with a 32 bit OS. This was the major reason for why a 64 bit architecture was created, not for speed.
I would be surprised if the BitShares code wouldn't compile on ubuntu 12, tho it might be a real pain to get the mix of packages you need to do so that don't conflict with your existing set. In my experience I've found it's easiest to use the recommended baseline of ubuntu 14.04 and follow the build instructions on the wiki. That worked for me at least.