I have a linux server (Ubuntu 10.04) which has no swap space (swapon -l reports nothing, 0kb swap memory listed in /proc/meminfo). The beginning of the output of top (sorted by %mem) is reproduced below:
top - 04:18:28 up 7:31, 2 users, load average: 0.93, 0.76, 0.71
Tasks: 25 total, 2 running, 23 sleeping, 0 stopped, 0 zombie
Cpu(s): 15.0%us, 0.8%sy, 0.0%ni, 84.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 4195200k total, 4177028k used, 18172k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP COMMAND
30075 admin 20 0 4026m 1.4g 9648 S 31 35.7 271:03.97 2.5g java
7700 root 15 0 170m 9152 4360 S 0 0.2 0:00.96 161m apache2
7730 www-data 15 0 171m 6268 1168 S 0 0.1 0:00.00 165m apache2
7726 www-data 15 0 171m 6232 1108 S 0 0.1 0:00.01 165m apache2
9520 www-data 15 0 171m 6228 1100 S 0 0.1 0:00.00 165m apache2
My confusion is how 4 GB of memory could be used with only about 40% of the usage reported (ps agrees with these numbers). Further, I am confused how more virtual memory could be allocated than resident when there is no swap space.
As reported, there is no free memory, apt-get failed due to a bad allocation. This too confuses me, as I thought the OOM killer would have sprung into action before this could happen.