# why "free" shows less memory than the hardware really has?

## al_alexander

when i use the "free" command (or by checking /proc/meminfo), i notice the total memory size is always less than the hardware actually provided.

for example, one of my desktop, with 4G memory installed, running 3.2.12-gentoo(amd64), i got:

  MemTotal:        3934312 kB

it's 254M less than theoretical size, for about 6.2% shortage.

on another server, with 48G memory installed, running rhel-2.6.9_5-9-0-0(amd64), i got:

  MemTotal:     49429304 kB

881M less than theoretical size, for about 1.8% shortage.

on a virtual machine, with 1G memory been assigned to, and running 3.0.6-gentoo(i686), i got:

  MemTotal:        1031720 kB

16.5M less than theoretical size, for about 1.6% shortage.

it seems that with more amount of memory, more size will "lost", yet the percentage varies with the different machines.

it can't be just "address taken by BIOS" or "space occupied by kernel image". they won't take that much. 

i've been googling for a long while without any reasonable answer. 

guess it's just too easy or too irrelevant to be discussed online, but i really really want to knowLast edited by al_alexander on Mon May 14, 2012 9:26 am; edited 5 times in total

----------

## LordVan

It might be good if you write in english or post it in the chinese forum: https://forums.gentoo.org/viewforum-f-50.html

----------

## al_alexander

 *LordVan wrote:*   

> It might be good if you write in englich or post it in the chinese forum: https://forums.gentoo.org/viewforum-f-50.html

 

terribly sorry ... it was a mistake, i will rewrite in english later

----------

## py-ro

Look here:

http://en.wikipedia.org/wiki/3_GB_barrier

The last one will be graphic-memory.

----------

## al_alexander

 *py-ro wrote:*   

> Look here:
> 
> http://en.wikipedia.org/wiki/3_GB_barrier
> 
> The last one will be graphic-memory.

 

thank you very much for reply!

but the number doesn't match, for the virtual machine i mentioned, i set graph memory to 32M. maybe the addresses of graph card were allocated from the higher end, beyond the 1G on-board memory.

and for the server with 48G memory, it dosen't even have a graph card, but still nearly 1G has "lost".

guess there's still something to it

----------

## py-ro

Check BIOS/EFI, sometimes remapping of memory must be activated (Memory Hole or something like this), some even can't do that.

----------

## the8lack8ox

If I recall my Operating Systems class correctly (and I don't know that I do), the kernel reserves a chunk of memory for it's own use (i.e. not userspace memory) which won't appear in most userspace tools.  The only memory free lists is that which is available for userspace, I think.  The discrepancy seen between your different systems is caused by the use of different kernels.

----------

## roarinelk

part of the address space is reserved for memory windows for various devices (system and PCI);

usually that's around 256MB; other parts may be used by the kernel for specialized purposes;

some might be reserved by the firmware for its uses, and so on. The rest is used for RAM if available.

----------

## Etal

Also if you have an integrated graphics card, it'll take a good chunk for it's own use (how much is often configurable in BIOS)

----------

