Ubuntu 4GB Ram Limitation and Solution

by Vivek Gite · 64 comments

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:
$ sudo apt-get update
$ sudo sudo apt-get install linux-headers-server linux-image-server linux-server

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

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 64 comments… read them below or add one }

1 Stephan Goeldi 12.27.08 at 6:40 pm

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 Xiao Haozi 12.27.08 at 11:54 pm

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 kakyo 12.28.08 at 3:15 am

Does Option #2 work for desktop version and for linux-rt kernels as well?
Many thanks.

4 blink4blog 12.28.08 at 4:21 am

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

5 Vivek Gite 12.28.08 at 7:00 am

@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.

6 hackers_125 12.28.08 at 1:18 pm

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: 0×00000000-0xc5d7ffff (rw)
Memory Size: 3 GB
Config Status: cfg=new, avail=yes, need=no, active=unknown

7 hackers_125 12.28.08 at 1:19 pm

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

Handle 0×000B, 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

8 Aleidatron 01.15.09 at 10:33 pm

With Option #1, you will max out at about 16 TB of RAM.

9 Richard Wolf VI 02.02.09 at 8:22 am

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.

10 Richard Wolf VI 02.04.09 at 12:40 pm

Nevermind, I solved it by enabling the driver (ath5k) manually in /etc/modules.

11 Brian 02.11.09 at 8:35 pm

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?

12 Vivek Gite 02.11.09 at 9:38 pm

@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.

13 Lance Zigler 02.19.09 at 2:33 am

This didn’t work for me at all:

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

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

14 CC 02.26.09 at 4:05 am

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.

Thanks.

15 Vlad Nistor 03.19.09 at 12:40 pm

Thanks a bunch! Just got 4Gb ram on my laptop and needed to use more than the 2.9 it was seeing.

16 eli 04.01.09 at 4:53 am

I tried option #2, and I still only have 2.9GB, even though I have 4gb installed. Suggestions??

17 Wagner Montalvão 04.17.09 at 5:11 pm

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

18 xiaoqiang 04.23.09 at 12:22 pm

I tried , and it works. But the server kernel is bloody slow.Unacceptable.

19 Vivek Gite 04.23.09 at 12:50 pm

I do not see any problem. We have several workstations used for engineering and R&D loaded with 8GB RAM or more RAM.

20 Wagner Montalvão 04.24.09 at 1:15 pm

Vivek, have you upgraded to 9.04 yet? Does it come with the PAE enabled kernel?

21 ghettodev 04.25.09 at 8:08 am

9.04 server kernel for x86 includes PAE and will recompile nvidia restricted with dkms automatically.

22 Natic 04.30.09 at 11:00 am

Have installed the 9.04 server kernel and 4GB RAM in my Notebook free -n shows only 3.2 GB

Any suggestions?

23 lime 05.04.09 at 7:00 am

dude, just install 64bit ubuntu. keep it simple

24 Nick 05.06.09 at 2:37 pm

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.

25 Driklyn 05.10.09 at 9:20 pm

Worked like a charm in Ubuntu 9.04. Thanks!

26 Domenico 05.21.09 at 7:28 am

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

27 Trevor 05.25.09 at 7:17 am

Hi,
PAE enabled kernel (2.6.28-11 server) works on Ubuntu 9.04, enabling me to see 4GB RAM, but I lose the ability to suspend/hibernate.
Mobile Intel® GM45 Express Chipset
4GB PC2-6400 (2GBx2)
Intel® WiFi Link 5100AGN
Laptop specs:
http://b2b.sony.com/Solutions/product-detail.do?prodId=SEL-M-140144&catId=SEL-yf-dncat-71302

Has anyone got suspend/hibernate to work on the server kernel?

28 Genie 06.09.09 at 2:10 pm

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

29 Ittay 06.18.09 at 6:20 am

@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?

30 mizar 06.20.09 at 10:36 am

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 !!

31 Geoff 07.01.09 at 7:58 am

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?

32 Vivek Gite 07.01.09 at 8:53 am

Did you rebooted Ubuntu into PAE kernel?

33 Trevor 07.01.09 at 9:00 am

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.

-Trevor

34 Nikolay 07.01.09 at 9:42 am

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:
https://help.ubuntu.com/community/Kernel/Compile
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.

35 tanveer 07.12.09 at 1:14 pm

i have 512mb ram ddr1, i never new 4gb ram existed, does this mean i can get 4gb and use it on ubuntu and XP

36 DaveGK 07.14.09 at 3:03 pm

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 :)

37 Vivek Gite 07.14.09 at 3:06 pm

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.

38 DaveGK 07.14.09 at 3:22 pm

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

39 desiNerd 07.29.09 at 9:14 am

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…

40 gonber 08.04.09 at 7:23 am

#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?

thks

41 gonber 08.04.09 at 11:14 am

just to add the restricted nvidia drivers updated automatically

42 Gregorio Espadas 08.18.09 at 1:30 pm

It works really fine for me. Thanks!!!

43 Gnothi 08.19.09 at 12:08 pm

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.

44 David Litster 08.24.09 at 5:21 pm

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.

45 Lars 08.27.09 at 12:16 pm

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

46 barontanaka 08.30.09 at 10:56 pm

Option #2 work fine with me, many thanks !!!

47 Richard 08.31.09 at 9:58 am

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.

48 Roy 09.07.09 at 2:10 pm

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.
Thanks

49 Pradeep Prakash 09.14.09 at 11:13 am

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!!)
Thanks

50 Garry Cook 09.29.09 at 11:13 pm

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.

51 Jaroslav K. 10.04.09 at 5:40 am

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.

52 sheck 10.05.09 at 6:10 am

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.

53 TS 10.05.09 at 8:55 pm

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.

54 Garry Cook 10.06.09 at 3:00 pm

@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.

55 TS 10.06.09 at 3:11 pm

@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.

56 Pat 10.12.09 at 1:46 am

option 2: works like a charm

57 eloiez 10.27.09 at 8:12 pm

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

58 Cam 11.24.09 at 5:31 pm

Option 2 : Works fine for me too, Ubuntu 9.10
All restricted drivers are in DKMS, so automatically updated.
Thanks a lot !

59 Marc 12.22.09 at 9:47 pm

Option 2 – Worked for me too.
Ubuntu 9.10 32-bit up to 6GB memory now.
Thanks very much!

60 joomla 01.05.10 at 12:29 pm

thank you cyverciti

61 Michel Graciano 01.14.10 at 11:40 pm

Option 2 – Worked for me too.
Ubuntu 9.10 32-bit up to 4GB memory now.
Thanks very much!

62 blink4blog 02.05.10 at 1:44 pm

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

63 arpagon 02.05.10 at 2:05 pm

Option 2 – Worked for me too.
Ubuntu 9.10 32-bit up to 4GB memory now.
Thanks very much!

64 spb 02.05.10 at 6:32 pm

I tried option #2. No dice.

# dmidecode 2.9
SMBIOS 2.4 present.
40 structures occupying 1532 bytes.
Table at 0×000E0000.

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

Handle 0×0126, DMI type 19, 15 bytes
Memory Array Mapped Address
Starting Address: 0×00000000000
Ending Address: 0×000FFFFFFFF
Range Size: 4 GB
Physical Array Handle: 0×0121
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?

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All