memory question
I'm a little confused - I have a Linode 512 and running free -m shows I've only got 498MB:
[root@li190-223 ~]# free -m
total used free shared buffers cached
Mem: 498 40 458 0 1 22
-/+ buffers/cache: 17 481
Swap: 255 0 255
[root@li190-223 ~]#
However I also have a 512 Burstnet VPS and running the same command gives 512MB:
linvak:~# free -m
total used free shared buffers cached
Mem: 512 23 489 0 0 0
-/+ buffers/cache: 23 489
Swap: 0 0 0
linvak:~#
Any ideas please?
7 Replies
I thought that the first field in free should display the total physical memory in the machine irrespective of kernel usage.
Guess I'm wrong
total used free shared buffers cached
Mem: 527 511 16 0 8 299
-/+ buffers/cache: 203 323
Swap: 255 81 174
@Mr Nod:
I thought that the first field in free should display the total physical memory in the machine irrespective of kernel usage.
Guess I'm wrong
:wink:
Well it probably should, but that doesn't mean it does, and it's not a serious issue.
@obs:
And distribution kernels show more!
I bet it's. erroneously adding the freed initrd memory to the total
$ ssh framboise dmesg | grep ^Memory:
Memory: 509956k/524288k available (5104k kernel code, 13672k reserved, 1584k data, 396k init, 0k highmem)
Those numbers don't exactly add up, but 509956 kB + 13672 kB comes up 660 kB short, and…. well, that's close enough to 640 kB that it ought to be close enough for anybody. Other messages spat by the kernel will provide a more detailed, and significantly more confusing, accounting.
Why the difference? Sometime between 2.6.18 ("Latest 2.6 Stable") and a few years back, the formula changed. Dunno where, who, or why, but it's probably more accurate now.
Think it'll be more accurate for me to parse dmesg then instead!