How to reconcile memory reports of "top" and "free -m" in Linux?

From free -m, I see that the machine has 377 MB of used memory and 1649 MB for free (of which 1567 ubuntu is cached). See below the actual output:

caz@riskvm:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          2026       1975         51          0         30       1567
-/+ buffers/cache:        377       1649
Swap:         3153         87       3065

However, when I look at the top output, I see processes using 1GB and 273MB in the RES column. RES means that it is in raw physical memory from a top-level page.

top - 11:45:26 up 1 day, 38 min,  3 users,  load average: 0.27, 0.21, 0.23
Tasks: 125 total,   1 running, 123 sleeping,   0 stopped,   1 zombie
Cpu(s):  0.2%us,  6.6%sy,  0.0%ni, 92.8%id,  0.5%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2075560k total,  2023796k used,    51764k free,    31264k buffers
Swap:  3229024k total,    89764k used,  3139260k free,  1605400k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 6689 root      20   0 1242m 1.0g 1.0g S   13 51.1 292:59.21 vmware-vmx
 6658 root      20   0  492m 273m 262m S    2 13.5  41:16.75 vmware-vmx
    1 root      20   0  2844  536  484 S    0  0.0   0:01.50 init
    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S    0  0.0   0:00.02 migration/0

I understand that some of them are shared by other processes (shared objects, etc.). But if there is 1 GB of memory shared by other processes, surely at least it should be used?

How does the free report on 377 MB of memory work, and when I look from above, I see processes using 1 GB or more of RES memory?

+5
1

, top, , mmaped framebuffers , nics "-ram" . , free, ram + swap.

+6

All Articles