8GB Memory Upgrade / PAE Mode

I’ve been doing more video processing lately, some of it HDTV quality, this was really demonstrating that 2GB was not nearly enough RAM for my system. Memory prices have dropped a lot since I did my frugal upgrade, at the time (early 2010) I spent $54 on a single 2GB stick. The other day I picked up 2x4GB for a mere $35 from CanadaComputers. Sure we’re now 2 years later, but to get four times the RAM for less?

In general I’ve had good luck with Patriot products, and looking at their warranty it looks like the have the standard limited lifetime warranty you’d expect.

My motherboard has 4 slots for RAM, so I could have left the 2GB stick in and added the two additional – but I decided against mixing things up. I figured 8GB was plenty for now, I can easily change my mind later. Installation was a snap, literally under 10mins including juggling all those cables.

Amazingly I got it right the first time, the BIOS showed me 8GB. Now as I’m running a 32bit version of Linux, I wasn’t surprised that the operating system couldn’t see all of my new RAM.

$ cat /proc/meminfo
MemTotal: 3482728 kB

So Linux can only see 3.3GB, I suspect why the value isn’t 4GB is due to the onboard video stealing some away from the OS.

The obvious upgrade path is to install the 64bit version of Ubuntu. It seems the smart path forward is to wipe and start again, however given that I’ve got a 1TB drive and it’s 60% full that’s going to be a long copy / install process. I mentioned this to a friend at work and he suggested that instead I use the PAE kernel, I’m glad he suggested it.

Physical Address Extension (PAE) is very easy to add to an existing 32bit Ubuntu installation. Assuming you’ve got a CPU that supports the feature (and with any current hardware you will), it’s a simple one line install.

$ sudo aptitude install linux-generic-pae linux-headers-generic-pae

After the install, a quick reboot and we’re running the new kernel. If you’re doing a clean install, recent versions of Ubuntu automatically add the PAE kernel if you’ve got enough RAM.

Now we can see all of the RAM

$ cat /proc/meminfo
MemTotal: 8072420 kB

This works out to 7.7GB, again some I believe is donated to the onboard video.

Why might you want to use PAE instead of running a 64bit version? If you elect to use 64bit mode, then all of your memory pointers need to be 64bits wide (aka double the 32bit size). This can cause some serious memory bloat depending on the type of application.

It should be no great surprise, but there is some work involved in getting applications to work in 64bit environments. For some applications, recompiling is all that is needed – however many have hidden dependencies on certain data structures being 32bit in size. It is for this reason that lots of software is still stuck back in 32bit – the mitigation is to run 32bit compatibility libraries.

With PAE, while the kernel can see all of the memory (up to 64GB) – each process is still limited to 32bit addressing (4GB max). You also miss out on some of the 64bit extensions to the instruction set, so you are leaving a little bit of performance on the table.

When I get around to doing a full wipe and re-install, I’ll likely move to a 64bit version of Ubuntu as it seems to be the recommended approach. I’m certainly glad I can put that off for a while longer and use PAE to get access to the increased memory with almost no effort.

Leave a Reply

Your email address will not be published. Required fields are marked *