I am using Ubuntu Linux 64 bit. Recently, I was using Ubuntu 32 bit, and discovered through the command grep --color=always -iw lm /proc/cpuinfo
that my processor is capable of 64-bit. The output of the command is:
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 syscall nx lm constant_tsc up pebs bts nopl pni dtes64 monitor ds_cpl tm2 cid cx16 xtpr
However, after wiping the disk and install Ubuntu 11.10 64 bit, the system still detects only 3.1 GB of RAM. I have verified in the BIOS that I have 4 gigabytes of RAM installed, not 3.1. Why is Ubuntu 64 bit only detecting 3.1 GB of RAM?
Output of uname -a
aaron@Aarons-Ubuntu-Computer:~$ uname -a
Linux Aarons-Ubuntu-Computer 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Output of free -m
aaron@Aarons-Ubuntu-Computer:~$ free -m
total used free shared buffers cached
Mem: 3136 2960 175 0 233 1996
-/+ buffers/cache: 730 2405
Swap: 3189 0 3189
About 80% of CPUs in use nowadays (and almost every single new CPU sold) support 64-bit Ubuntu, so this doesn't come as a surprise. There are plans to suggest 64-bit Ubuntu as the default (the way 32-bit is suggested now) as most people's hardware is capable of running it.
Still, to see the total memory as seen by the kernel, as well as a report on how it's initially allocated, you can do this:
This will show a line such as this one:
My system has 4GB of RAM installed, however the total reported is something like 4.7 GB (I'm guessing the BIOS reports more memory due to address space for the video cards, PCI and IO devices and others). In the end only 3.6 GB are available to applications due to these concerns.
Note the "absent" memory amount, this "reflects the memory addressing space lost due to memory holes in the memory map. Typically holes are left for PCI space, IO, etc.. Every vendor model system is different, and every system will have a different value reported for the absent memory."
Also look at the question pointed to by fossfreedom, it gives you some more of an explanation of where addressing space may be being used.