Re: free reporting wrong values?

Jean-David Beyer wrote:
How come buffers is so low? I have never seen it anywhere near that low on
any of my machines. The machine I am on as I type this is essentially idle,

Now buffers is even 0. The recent output of "free" is:

$ free -m
total used free shared buffers cached
Mem: 7987 6333 1654 0 0 4593
-/+ buffers/cache: 1740 6247
Swap: 2055 32 2022

Now if I tried to grab memory in excess of what I already have (up to 4GB on
my *86 machine with 2 hyperthreaded Xeon processors), it would start paging
stuff out to get it (I suppose).

Now my little memtest program (the link to the source code can be found in my original posting) can reserve nearly the amount of memory that is reported as free. If I take the size of the program itself into account that seems to be ok; however, why isn't the cache size reduced when my application requests more memory?

Do you have a 32-bit or a 64 bit machine? I ask because the 4GB includes
both your program and your data. If you were on a 32-bit machine, and your
program already used about 2.5 GBytes, you could get only around 1.5 more,
and even that depends on your kernel. For some, you can get only about 3.5
GBytes total.

It's a 64 bit machine with a 64 bit kernel:

$ uname -a
Linux db1 #1 SMP Sun Feb 10 22:48:05 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux

I think my application is 32 bit, but it is small enough that it should nonetheless be able to get at least 3 GB of memory.