Ubuntu 4GB Ram Limitation and Solution

last updated in Categories , ,

Q. I’ve total 8 GB RAM installed in my dual boot Ubuntu Linux 8.10 (32 bit) version HP workstation. But free -m command only shows 3291 (3G) memory. How do I use 8GB RAM under Ubuntu Linux?

A. You need to install Physical Address Extension (PAE) aware kernel under 32 bit Ubuntu Linux. It is a feature of x86 and x86-64 processors that allows more than 4 Gigabytes of physical memory to be used in 32-bit systems.


Without PAE kernel, you should see something as follows:
$ free -m
Sample output:

             total       used       free     shared    buffers     cached
Mem:          3291        801       2489          0         95        342
-/+ buffers/cache:        363       2927
Swap:         1906          0       1906

You have two options here as follows:

Option # 1: Use 64 bit Ubuntu Linux

64 bit Linux kernel will take care of 4G or more memory. Just grab latest 64 bit version and install it.

Option #2: Install PAE enabled kernel

Open terminal and type the following command if you are using Ubuntu version Ubuntu v9.04 and earlier:
$ sudo apt-get update
$ sudo sudo apt-get install linux-headers-server linux-image-server linux-server

If you are using Ubuntu v9.10 (Karmic Koala) and above, enter:
$ sudo apt-get install linux-generic-pae linux-headers-generic-pae
Once kernel images installed, just reboot your workstation, type:
$ sudo reboot
After reboot, login into your system and type the following command to verify memory usage:
$ free -m
Sample output:

             total       used       free     shared    buffers     cached
Mem:          8105       1292       6812          0         38        483
-/+ buffers/cache:        770       7334
Swap:         1906          0       1906

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


114 comment

  1. One should mention, that with 64bit Linux your applications will use about 160% of RAM (compared to 32bit). This is because of the different memory addressing. 32bit PAE kernel does not use more RAM. If you do not use special 64bit optimized programs (e.g. some sql apps etc.), 32bit with PAE is the best way to go.

  2. With 8GB of RAM, having slightly different memory mapping isn’t going to really be an issue unless they are using it for hardcore server usage (esp. java servers). Going 64bit is my recommendation, hands down. I’ve notice a lot of performance increases in many of the libraries over 32bit installs. For most of us, it’s just a matter of preference and I really prefer a solid 64bit installation.

  3. how about restricted drivers? i once tried upgrading it using 32-bit PAE but the result ended the system failed to initialize X windows.

  4. @blink4blog,

    You need to first disable restricted driver. Install PAE kernel an d reboot. After reboot, enable restricted driver. This should fix the problem.

    @ kakyo,

    It should work.

    @Xiao Haozi
    You are right, you may gain 30-40% performance boost with 64 bit kernel and libs. However, many desktop apps are not ready for 64 bit stuff like multimedia. Anyways, it is matter of choice.

  5. for its not working.. i think the bios is lock the 4GB usage.. that me right..

    11: None 00.0: 10102 Main Memory
    [Created at memory.61]
    Unique ID: rdCR.CxwsZFjVASF
    Hardware Class: memory
    Model: “Main Memory”
    Memory Range: 0x00000000-0xc5d7ffff (rw)
    Memory Size: 3 GB
    Config Status: cfg=new, avail=yes, need=no, active=unknown

  6. but using the dmideco it show that my motherboard support up to 4g

    Handle 0x000B, DMI type 16, 15 bytes
    Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 4 GB
    Error Information Handle: Not Provided
    Number Of Devices: 2

  7. I managed to use the server kernel, and successfully using PAE. Unfortunately, my WiFi card doesn’t work (even while being detected in lspci), so I lose my net connection. Any solution for that? My card uses the Atheros driver.

  8. I have Ubuntu 8.04 – intel Quad with 4GB showing 3.2GB as above. I’m trying to decided to do the PAE or 64Bit. This is a desktop. I think its originally an Ubuntu Server install and then I install ubuntu-desktop.
    I have a new Nvidia video card. I don’t know if I should install the new video card, then try to do the upgrade to PAE or do the PAE upgrade, then install the Nvidia card and restricted drivers.
    Or just go 64bit install with the nvidia card already plugged in and hope stuff works!
    I need to develop Java and Rails apps on this box.
    Any thoughts?

  9. @Brian,

    Go with 64 bit if you do not plan to use lots of multimedia stuff as most plugins only works with 32 bit system.

    You can install Nvidia card, install the PAE kernel, reboot the system. Download driver from offical website and install it or just enable restricted driver.

  10. This didn’t work for me at all:

    % uname –r ; free -m | grep -w Mem
    Mem: 3037 715 2322 0 21 296

    Bios and dmidecode see the 4gb fine… any tips?

  11. If I convert from desktop to server this way will I loose my GUI? I also run virtualbox so I would prefer NOT to have to any major changes to my system other than upgrade the kernel.


  12. eli,

    Assuming you have installed the 32bit modules suggested by Vivek Gite, try to run the following command as root/sudo:

    apt-get install linux-restricted-modules-server

  13. It’s not always that simple.

    I’ve got 9.04/64bit on my vm server, but I can only see 3.5 of 4G. Dell’s BIOS is ‘doing me the favor’ of chopping out 512M because they never thought I’d put a 64bit OS on my 64bit CPU

    If anybody knows how to force ubuntu to ignore ‘reserved’ on bios reported memory zones, I’m all ears.

  14. Really thank you………I’ve already done the option 2 and now I can see 3,9 Giga available (before 3 Giga).

  15. 2 Trevor:

    To use suspend/hybernate you must have two things:
    – hardware support (you have it)
    – Enough space in swap partition (for you choise swap space must be equal or greater than your RAM size, eq, no less, than 4GB)
    For check, run:
    cat /proc/swaps

  16. @Genie: I don’t think suspend has any need of the swap. I experience the same problems as Trevor in my T61 but with the generic kernel suspend works fine even though my swap is only 2GB. what does suspend write to disk?

  17. I confirm that in 9.04 the update suggested for 32-bit desktop version in the blog works perfectly.

    Also i have ATI hd3470 and restricted drivers were automatically updated.

    Thanks !!

  18. I did all the steps up there with a system that has 12gb of ram installed, but when I execute free -m It only shows up with 3014 total. Whats the next step down the road to more memory?

    Also am I going to be able to get it to address all 12 gigs?

  19. Hi,
    Thanks for the response. I have a big enough swap partition at 7GB and the computer will sleep/hibernate in the generic kernel, but it won’t in the server kernel.


  20. FYI : there is one more catch with the Ubuntu server kernel – you can not run VMWare
    because of conflicting virtualization technologies. It is a pity Ubuntu does not support
    desktop PAE kernel (as many, not to say most other distributions do). Of course there
    is always the option of compiling a kernel of your own as described here:
    but many would feel uncomfortable doing that.

    And one remark to the title of the article : unfortunately the limitation for memory is not even
    4GB but 3 since 1GB of address space is set aside for purposes other than memory addressing.

  21. I’m about to get a new laptop and am still undecided as to which way to go – i.e. 64bit or PAE. Probably PAE, as I have a fair amount of multimedia stuff on my present laptop, and I do need to run Sun VirtualBox (unfortunately, there’s still no adequate substitute for Acrobat Pro, CorelDRAW and, to a lesser extent, Photoshop). Will I be able to do that in Ubuntu server? Nikolay mentioned that VMWare won’t run with server kernel, what about Sun VirtualBox? Also all those niceties – Compiz, Cairo-Dock etc – will they be okay on server (might be a silly question, but server doesn’t sound like something designed for that sort of things) – I’ve only been using Linux for a month or so :)

    1. You better go with 32bit oses to load all the stuff. 64bit is more suitable for server usage and not for multimedia or other windows apps.

  22. Thanks, that’s what I suspected…
    What about Cairo-Dock, Compiz and Sun VBox? Will they run OK in Jaunty server kernel?

  23. as far as I can understand if you want a faster processing and you can afford buying 64 bit OS(which I guess would be dirt cheap, if you are upgrading from the current 32-bit OS) better go for it. as some one already made it clear that 32-bit machine can’t address beyond ~3.6 gig memory, its better to have 4gig ram along with a 64-bit OS. obviously you will get a better performance and you always have the option of putting 32-bit stuffs on your 64-bit machine(more or less its works fine). 64-bit is the “in” thing, so you should better go for it.
    yesterday only i ordered dell studio 15 with 64bit Vista home premium, 4 gigs ram, 320 7200rpm hdd, etc …i’m planning to install ubuntu 64-bit on this, i hope there wont be any problem. lets hope for the best. btw, thanks guys for all your reviews…

  24. #2 just worked out of the package! fine…

    The details:

    Linux xxx-laptop 2.6.28-14-server #47-Ubuntu SMP Sat Jul 25 01:18:34 UTC 2009 i686 GNU/Linux

    total used free shared buffers cached
    Mem: 4021 342 3678 0 4 170

    any ideia on how to put intel turbo memory working?


  25. I loaded the server kernel into desktop Ubuntu Hardy. It works fine with Sun VirtualBox and Compiz. Nvidia driver module automatically rebuilt. No apparent slowdowns.

  26. Thanks a lot for the tip! However, after I installed the kernel and rebooted, something really bizarre happened: My machine wouldn’t boot anymore. After the BIOS, it just sits with a blinking cursor. No grub prompt, no nothing. I can get it boot via the Hardy livecd, choosing “boot from the first hard disk”, but reinstalling grub, et. al., seems to have no effect. Does anyone have any idea why my bootloader would be hosed after a simple kernel upgrade?

    On the plus side, I can now address all 4 GB of ram in 32-bit Hardy.

  27. How do I get the 64bit kernel without new installation – I this possible and all applications will run (I only have VMware installed)?

    Thanks & best regards from Germany

  28. For those running VMware, or who want to recompile the kernel, I really recommend following this part of the Kernel/Compile page from the Ubuntu kernel team

    This is a lot easier than the method shown in first half of this page. I just set HIGHMEM64G and unset HIGHMEM4G in the .config file, then did a ‘make xconfig’ file to check via the config GUI, then recompiled as per this howto.

    VMware Server 2.0 is now working nicely with this custom kernel, 2.6.24 based. I didn’t try very hard to get it working with the normal Ubuntu Server kernel, but VMware didn’t work out of the box, hence going for a custom kernel.

  29. I had 4025mb of ram installed, but only saw 3275mb. I have all 4025mb working now.
    I copied the ($) the first time in the terminal, duh, don’t do that.
    Took my PC about 5 minutes to DL and install. Very slick and easy.

  30. Hi,
    I have the latest Ubuntu 9.04 Desktop version installed on my T61 Lenovo and everything is working like magic except for the memory ( 2.9Gig available instead of the installed 4Gig). If I use the above method and install the server edition kernel,

    1. Is it going to affect anything on my system? Like the suspend/resume/hibernate functions
    2. Are there any other side effects? ( WiFi driver problem, display driver problem, sound card driver problem).
    3. Also, I have recompiled some of the other software with my own customizations, Will it be affected? ( mplayer with CoreAVC to play HD, XBMC with a little modification)
    ( I think it should NOT affect any one of these, but wanted to confirm!!)

  31. Followed the simple instructions to install the server kernel in Ubuntu 9.04. Nvidia and other kernel modules were automagically installed in the new kernel (very slick!). Compiz still runs smooth and Virtualbox still runs my Win7 instance just fine. No apparent bad side effects.

    However ‘free -m’ still reports a total of 3275 bytes of RAM. So, the fix didn’t work for me.

    I am definitely using the new kernel, as ‘uname -r’ shows 2.6.28-15-server.
    This is running on a Dell D820 laptop. I guess I’ll check the BIOS and see if there are settings there that I need to change.

  32. Don’t forget: if you see less RAM as physically is installed, it could be that your video card is using shared memory (especially in laptops). So go to BIOS and see how much of RAM there is set for video card.

  33. Installed kernel with PAE and enabled memory mapping in BIOS. Now OS sees all 8 GB that I have. No problems with Suspend/Hibernate or anything else, so far. Running Ubuntu 9.04 Desktop with server kernel. Intel Core 2 Duo CPU.

  34. I’m in the same situation as @Garry Cook, but I’m using a Dell Latitude D620. Any suggestions? I really need the full 4GB’s I just installed on this machine.

  35. @TS, it looks like we won’t ever be able to see the full 4GB. From what I’ve read (and I’ve been researching this extensively), this is a hardware limitation of the Intel Mobile 945 chipset. I was hoping there would be a BIOS update available to fix this, but it does not appear to be possible.
    Many people continue to say that it is a limitation of a 32 bit OS. While this may be true, an upgrade to a 64 bit OS will not solve the problem for those of us with the Intel Mobile 945 chipset.

  36. @Garry Cook, thanks for your help. That is pretty upsetting. Does the same issue exist for Windows as well? Any idea how I can undo/uninstall everything I just did? For some reason, my VPN is not working properly after I ran “sudo apt-get install linux-headers-server linux-image-server linux-server”. It keeps saying:
    Secure VPN Connection terminated locally by the Client
    Reason: Failed to establish a VPN connection.
    I have verified that this is not a VPN specific issue. I need this to work ASAP so anyone that could help me undo what I just installed I’d be greatly appreciative. I tried a simple sudo apt-get autoremove linux-headers-server linux-image-server linux-server (using ‘autoremove’) but that only removed 3 packages at ~93kb (said it removed the server files, but strangely enough it still exists and runs fine from GRUB). Any help would be appreciated. Thank you.

  37. works fine for me (toshibe satellite pro P300-274)
    suspend/resume is ok
    hibernate/resume fails
    No message in the log
    Any Idea ?

  38. after some time i patronized here again via StumbleUpon and found that i were here back then. by the time i am writing now i already on the bandwagon of amd64 9.10 and all drivers work fine with me, at least nVidia graphic driver.

    doing PAE does not really solve the entire issue because it creates another issue, i.e. for each process cycle of the CPU instructions set, the PAE get the CPU to do double the work just to achieve 64-bit wonders.

    i try to explain using layman term, for more technical explanation, you have to heads off to Wiki.

    just my 2 cents

  39. I tried option #2. No dice.

    # dmidecode 2.9
    SMBIOS 2.4 present.
    40 structures occupying 1532 bytes.
    Table at 0x000E0000.

    Handle 0x0000, DMI type 0, 24 bytes
    BIOS Information
    Vendor: Apple Inc.
    Version: MBP22.88Z.00A5.B07.0708131242
    Release Date: 08/13/07

    Handle 0x0126, DMI type 19, 15 bytes
    Memory Array Mapped Address
    Starting Address: 0x00000000000
    Ending Address: 0x000FFFFFFFF
    Range Size: 4 GB
    Physical Array Handle: 0x0121
    Partition Width: 0

    ~$ uname -a
    Linux spbdada 2.6.31-18-generic-pae #55-Ubuntu SMP Fri Jan 8 16:13:23 UTC 2010 i686 GNU/Linux

    So the PAE kernel is running…

    ~$ free -m
    total used free shared buffers cached
    Mem: 3009 2916 92 0 29 384
    -/+ buffers/cache: 2503 506
    Swap: 0 0 0

    But still only seeing 3Gs.. Any ideas?

  40. Option 2 worked wonderfully for me. I am new and this was my first successful operation in the terminal. I am using main edition of Mint 8 Helena on a Toshiba Laptop w/ Core 2 duo P7350 w/ 4gb ram. I experienced no difficulties with hibernation or suspension. Previous to the installing PAE, my system only showed 3GB whereas, now it shows 4012MB. Thank you for the easy solution!

  41. Fyi, this is my kernel config, so I don’t think it’s an issue.

    cat /boot/config-2.6.31-20-generic-pae | grep HIGH
    # CONFIG_NOHIGHMEM is not set
    # CONFIG_HIGHMEM4G is not set
    # CONFIG_DEBUG_HIGHMEM is not set

    I’d really appreciate some help/pointers on this.

  42. My ubuntu 9.10(karmic) 2.6.31-20 x86_64 kernel desktop has 4GB memory. dmidecode tells me as well. The system has 256MB graphics card, intel Quad cpu.

    top, free, system-monitor tell me the memory only 3.2GB.

    According to the above suggestions, it should show 4GB Ram. It doesn’t show me that? Why? What is the best solution?

  43. Opcion 2 don’t work

    total used free shared buffers cached
    Mem: 3014 865 2149 0 51 416
    -/+ buffers/cache: 396 2617
    Swap: 5773 0 5773

    is the same value

  44. This worked like a charm. I have an HP ProBook 4510s and it had 2GB RAM. It was fine for normal use, but then I was having problems running virtual Windows machines on it while also running Tomcat with Hudson, and then it would swap like crazy when I opened Eclipse. So I bought another 2GB and only 2.9MB was available. I then switched to the PAE kernel and the full 4GB is now available. Thanks very much!

  45. could those people with only 3.2gb showing up confirm whether they have an Intel i945PM. mine does and it only shows 3.2 before and after enabling pae. iread somewhere that it’s the limitation of the chipset.


  46. For all the people having issues with the PAE kernel still not seeing the full 4GB: I had this problem as well, and it turned out I had to enable “memory remapping” in my BIOS. Turns out this will make sure that the upper 2GB is mapped at address 4GB+. This means that if you then use a 32-bit kernel you will only see 2GB, but if you use a PAE-enabled or 64-bit kernel it should see everything.

  47. Installed 4GB in my Sony Vaio VGN-NS140E. Running PAE kernel in Ubuntu 10.06 and. . .

    3861 MB of RAM.

    So I’m missing a few hundo here. If anybody knows why I’d love to hear a fix.

    Still a cool tip, thanks much.


  48. Worked for me. Thanks!
    Earlier: 2.9 GB.
    After installing pae: 3.9 GB
    System: 10.04 (upgrades: 9.04->9.10->10.04, not a fresh install)

  49. Worked beautifully on Ubuntu 10.04.

    Had 2GiB and upgraded to 6GiB.

    Only saw around 3.2GiB. After this hack, it sees all of the 6GiB.

    Thanks a million for this hack.

  50. I just put 6GB onto a motherboard Gigabyte GA-P35-DS3 with Ubuntu 32 bit desktop with PAE 10.04 Lucid. Have a look at this:
    user@ubuntu-desktop with PAE:~$ free -m
    total used free shared buffers cached
    Mem: 6049 5857 191 0 68 843
    -/+ buffers/cache: 4945 1103
    Swap: 4102 0 4102
    user@ubuntu-desktop with PAE:~$
    Writing this comment six VMs are runing in VirtualBox and some applications on the host (Firefox, Thunderbird, …). All the activities use 4.8GB RAM of the 5.9GB which are offered by the system manager. That ist Linux :-) … I can not stop smiling.

  51. Dual Boot: For those preparing too switch to Ubuntu 64 bit version and have Vista 64 bit installed I highly recommend using a separate hard drive to install the newest kernel 10.04 to. In addition unplugging your vista hard drive at installation time will prevent an overwrite to your MBR (master boot record) on your Vista Installation. In this fashion you can start either operating system from your BIOS not within Ubuntu. That way if you ever want to upgrade to Windows 7 your MBR won’t be a mess. Of course same follows you will need to unplug your Ubuntu installation if upgrading from Vista to 7. I gave my swap partition more than the 8 gig of memory installed so I could run other background programs at start up.
    2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UTC 2010 x86_64 GNU/Linux
    free -m
    total used free shared buffers cached
    Mem: 8003 1184 6818 0 96 486
    -/+ buffers/cache: 601 7401
    Swap: 9703 0 9703
    Biostar TA790GX 128m
    8 gig pny memory ddr2 800
    AMD 9750 quad core cpu
    Vista ultimate 64 bit/Ubuntu 64 bit

  52. 4GB RAM only map 3.2GB. dmesg logs

    [ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
    [ 0.000000] original variable MTRRs
    [ 0.000000] reg 0, base: 0GB, range: 2GB, type WB
    [ 0.000000] reg 1, base: 2GB, range: 1GB, type WB
    [ 0.000000] reg 2, base: 3GB, range: 256MB, type WB
    [ 0.000000] reg 3, base: 3327MB, range: 1MB, type UC
    [ 0.000000] total RAM covered: 3327M

    $ uname -a
    Linux machine #1 SMP Fri Dec 3 12:19:41 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

  53. Does not work with Ubuntu 11.04 64bit. No PAE kernel’s are available for this version at the time of this comment.

  54. just installed 11.04 32 bit on my vaio f13z.. without any problem. Suggestion above rised my RAM to 8GB. I hope there will be a ia64 version of 11.04..

  55. Hi,

    I have an eMachine D520 with Ubuntu 11 and Vista 7 with photoshop and others on VirtualBox. I want to upgrade to 4GB ram but the PC is not booting when I install the other 2GB ram stick. My video card is using 64MB. aaron@soaresart.com
    Do you think PAE will help it or not?
    If PAE will help it, will virtualbox still work? coz its what I use to process my images as Im a photographer and cant afford any down time.
    BTW, both ram sticks are Crucial 2GB 200pin ddr2 sodimm 256mx64.


  56. I would like to add that using the 32-bit version means your software is not able to use the additional CPU registers of the AMD64 architecture.
    Plus, if you use PAE, your system will have a 36-bit address space (up to 64 GiB), but each individual process will still have only a 32-bit address space (i.e. will only address 4 GiB).

  57. I am using a physical machine for server
    Configs are
    Core2Duo E 4400 2.Ghz (EM64T capable)
    4x2GB DDR2 667 Mhz RAM in Dual Channel
    in my BIOS it shows total RAM as 8096 MB
    and i Did download Ubuntu server 10.04.3 64 Bit for AMD 64 platform(which has support for xeon core2Duos and core2Quads etc)
    and installed it .
    when i type in terminal ” free -m ” to check the ram it shows as 3216 GB

    and for cpu info when i typed this ” grep flags /proc/cpuinfo ” i got the following flags

    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm

    also this command clearly verifies that my CPU suuports PAE

    grep –color=always -i PAE /proc/cpuinfo”

    CPU Modes:( Source Ubuntu Forums )

    lm flag means Long mode cpu – 64 bit CPU
    Real mode 16 bit CPU
    Protected Mode is 32-bit CPU

    And after 10.04 LTS server edition 64 bit i tried 11.04 64 bit server edition still am facing the same problem just 3.2 gb ram is visible with ” free -m ”
    when using ” dmidecode | grep Size | grep MB ”
    it shows 4 x 2 GB modules connected to the system ..
    please help me with this :S

    1. Have you already activated “memory hole remapping” (or something) in your BIOS? The BIOS itself sees all the 8 GiB, but for the OS to see everything the remaining memory must be mapped above the PCI memory hole. Apart from that, I don’t see why an amd64 OS version wouldn’t address memory the BIOS does.

    1. I’m interested to get some more details of your Ubuntu 11.10 experience. Which of the 2 solutions did you use (64 bit or PAE)? Did you use Xubuntu? How much RAM on your system?


  58. Thank you very much!!!
    Followed the 2nd option…
    On Ubuntu 11.04
    intel 920
    Asus P6T
    OCZ 3G1600LV DDR3

    total used free shared buffers cached
    Mem: 6033 1059 4974 0 202 395

    Thanx mate!

  59. I followed the second option, but after the ‘free -m’ command I still get 3GBs of RAM in the list of results while I have 4 installed. The ‘apt-get install linux-restricted-modules-server’ command listed the following:

    ‘Building dependency tree
    Reading state information… Done
    E: Unable to locate package linux-restricted-modules-server’

    I read some advice regarding restricted packages in comments above – is this related to that and what exactly should I do?

    Thanks in advance

Leave a Comment