Using more than 3 Gb of RAM with 32-bit Ubuntu 10.04 (Lucid)

Here’s a tip for those still running a 32-bit version of Ubuntu on machines with more than 3 Gb of RAM (like myself).

Earlier versions of the ‘generic’ linux kernel that shipped with Ubuntu had PAE (Physical Address Extension) enabled by default. This meant that on 32-bit installations, you had access to greater that 3 Gb of RAM. This seems to not be the case with the default Lucid (10.04) kernel – it’s not PAE enabled. I’m not sure exactly when the change was made (it could have also been the case with 9.10), but I noticed that after upgrading to Lucid, my 32-bit installation was only seeing ~3 Gb or RAM, when previously I had access to the full 4 Gb installed.

You can tell how much RAM is accessible by in a terminal typing:

free -m

For 4 Gb of RAM, the ‘total’ mem should be something like 4003.

To fix this, simply install the PAE-enabled kernel:

sudo apt-get install linux-generic-pae

This kernel should automatically become your default in GRUB. All going well, after a reboot, you should be able to type ‘free -m’ again and see that you are using 4 Gb of RAM.

14 thoughts on “Using more than 3 Gb of RAM with 32-bit Ubuntu 10.04 (Lucid)

  1. I guess I’ll have to keep looking, this didn’t seem to work for my Ubuntu 10.04 32-bit. But thanks for trying.

  2. Sorry it didn’t work for you .. it’s worked for me on two machines so far. Two more checks, just to be sure – Did you check that the -pae kernel was in use after a reboot (with uname -a) ? Does the BIOS show the correct amount of installed RAM (there could always be a faulty stick) ?

  3. Doesn’t work for me either on my ubuntu 10.04 2.6.32-24-generic-pae. I even tried installing directly the 64bits version of ubuntu 10.04 and free -m still only 3Gb. In the bios i can see the 4Gb ram installed. Computer is an HP dv6355ea.

  4. I bit of digging ( “Enabling PAE” ), and I discovered that in fact older versions of Ubuntu didn’t have PAE enabled in the stock “linux-generic” kernel either .. you needed to use the “linux-server” kernels in 9.04 to get PAE support. With 9.10+ there are PAE kernel packages called “linux-generic-pae”. I don’t think there is any simple switch that can be flicked to make the default “linux-generic” kernel support PAE as-is – I’m assuming it hasn’t been enabled at compile time.

    Personally I don’t really see installing a variant of Ubuntu’s official kernels as all that drastic – regular Ubuntu updates will typically upgrade the default “-generic” kernel several times a year anyway, and most people wouldn’t even notice that it’s happening except that they are prompted with “Restart required” after apt-get upgrades a kernel. Installing the “-pae” variant is barely any different.

    [For the ultra geeky: You could download the “-generic” and equivalent “-generic-pae” kernel source and do a ‘diff’ between them .. I bet there are very few source code changes, other than the config flag that says “compile the PAE stuff” (no time to check that myself just now, unfortunately). ]

    In the case where you are using your own custom compiled kernel modules (or custom kernel), yeh, then changing kernels is drastic – but then anyone doing that would probably be comfortable with it anyhow 🙂

  5. Good point, I’m now running the linux-generic-pae kernel and just ran into the ‘custom compiled kernel module’ problem with VirtualBox. I had to install the linux-headers-generic-pae package to get VirtualBox to recompile its own kernel module.

    Recompiling kernel modules is a minor inconvenience, I’m more worried that the linux-generic-pae package isn’t maintained as closely as the non pae package. I’m not familiar with how Linux kernel development goes but do you think it’s possible that the stock linux Kernel that Ubuntu comes with and what comes with the linux-generic-pae package could drastically fork?

    Thanks for your help!

  6. Thanks for this. I am kind of curious though. I never rebooted and free -m is showing the full 4gb as available. Now I am not sure what to do on reboot.

  7. R.J: It seems every time a new -generic kernel update it released, the -generic-pae comes out at the same time, so from Ubuntu / Canonicals side it seems to be maintained as a first-class option with regard to security updates etc. The PAE kernel and the ‘regular’ kernel are generated from the same source tree – there isn’t a separate code base for the PAE version, just a compile time flag CONFIG_X86_PAE=y, so while different, they can’t easily diverge too much.

  8. Kurt: The new kernel will only become active after a reboot (and should normally be at the top of the GRUB menu, so will boot by default). Are sure you are running a 32-bit version of Ubuntu 🙂 ? If you see 4 Gb before a reboot, then I’d say you don’t need the PAE kernel and are probably running a 64-bit kernel.

    You can find out which kernel you are running with:

    uname -a

    and it’s architecture specifically with:

    uname -m

    If this says x86_64 or ia64, you are already running a 64-bit kernel. In this case, I can’t see any good reason to run the PAE kernel.

  9. Installed 10.04 32-bit on a machine with 8GB RAM, it automatically installed the PAE kernel without my doing anything.

    pjziggy@lelouch:~$ uname -a
    Linux lelouch 2.6.32-38-generic-pae #83-Ubuntu SMP Wed Jan 4 12:11:13 UTC 2012 i686 GNU/Linux
    pjziggy@lelouch:~$ free -m
    total used free shared buffers cached
    Mem: 8065 1591 6473 0 113 241
    -/+ buffers/cache: 1236 6828
    Swap: 8856 0 8856

Leave a Reply

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