I have a 64bit desktop, running 32bit Debian - with 2G memory.
user@box:~/$ head -n 1 /proc/meminfo MemTotal: 2030324 kB
But when I ask free to report on memory I see:
user@box:~$ free -g
total used free shared buffers cached
Mem: 1 1 0 0 0 1
-/+ buffers/cache: 0 1
Swap: 2 0 2
I am confused as to why free reports only 1G total memory when actually physical memory is 2G. Could someone explain how to correctly reconcile the output of free against my machine spec?
This is a rounding issue. For example on one of my machines:
7,881 MiB is actually ~7.70 GiB but
free -g
is rounding down to 7 rather than up to 8. Likewise there is ~4.98 GiB free memory butfree -g
is rounding this down to 4 not up to 5.Total memory reported by
free
does not include memory the kernel can not access (in the case of the server above due to chipset limitations not letting the last chunk of the 8Gb is has be used, in some cases a machine's video card may claim some RAM if it doesn't have its own) nor does it report the small chunk of RAM the kernel is unpacked into at boot (so on one of the smaller VMs on the host above which has 128M allocated, free only reports 126,616 K, 123 M (where it is actually more like 123.6 M) or 0 G) - so you will never see the same value as your physical total RAM infree -g
.In your case
free
is seeing 1,982.7 M or 1.94 G which it is rounding down to 1.