Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How do I get the actual used memory including RAM disks?

If I add up all the memory usage I get from top -b -n 1 or htop or ps aux, I get a number that is a few GB under what I get with free. The kernel could account for some of that memory, but not up to a few GB, could it ?

share|improve this question

marked as duplicate by Uri Herrera, Jorge Castro, Nitin Venkatesh, izx, jokerdino Aug 16 '12 at 8:04

This question was marked as an exact duplicate of an existing question.

I guess not, the accepted answer for that question is using 'htop', which I know about and even mentioned in my question as not solving my issue... – bob Jul 1 '12 at 5:28
Could you share some more info, such as the output of these commands: free -m; cat /proc/meminfo; swapon -s – medigeek Jul 1 '12 at 6:25
#free -m: [mem] total: 16000. used:15800. free:200 buffers:600 cached:12000. [-/+ buffers/cache:] used: 2000. free: 13000. #cat /proc/meminfo MemTotal: 16411300 kB MemFree: 215196 kB Buffers: 625596 kB #I don't have swap (shouldn't need it with 16GB...) – bob Jul 11 '12 at 0:10
up vote 0 down vote accepted

Check the output of free -m. It will look similar to this:

             total       used       free     shared    buffers     cached
Mem:          7459       1483       5975          0         63        730
-/+ buffers/cache:        689       6769
Swap:         9536          0       9536

With different numbers probably. The first line ("Mem:") gives you the overall consumption, including cache and buffers (to speed up things, Linux uses free RAM to cache things like e.g. file system info -- see the "cache" column in my example. If the RAM occupied by this cache is needed elsewhere, that cache will shrink to free it). So look at the second line ("-/+ buffers/cache:"), which gives you the amount of memory really used by applications (plus kernel etc. of course). This should usually rawly match your calculation.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.