我无法找到内存使用情况,但是 top 显示了以下结果。
Tasks: 90 total, 2 running, 88 sleeping, 0 stopped, 0 zombie
Cpu(s): 21.1%us, 1.4%sy, 0.0%ni, 74.0%id, 2.4%wa, 0.0%hi, 1.0%si, 0.0%st
Mem: 8313376k total, 7969976k used, 343400k free, 185496k buffers
Swap: 4096564k total, 92k used, 4096472k free, 7511688k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28213 apache 15 0 48964 33m 3264 R 56.6 0.4 0:07.64 httpd
25170 mysql 23 0 156m 39m 4688 S 37.3 0.5 83:34.76 mysqld
1469 root 10 -5 0 0 0 S 0.3 0.0 28:40.90 kjournald
25981 root 15 0 10192 2936 2352 S 0.3 0.0 0:00.69 sshd
1 root 15 0 2156 644 552 S 0.0 0.0 0:05.31 init
并免费展示以下内容。
total used free shared buffers cached
Mem: 8118 7764 354 0 181 7335
-/+ buffers/cache: 247 7870
Swap: 4000 0 4000
Total: 12119 7764 4354
谁能告诉我如何才能找到 top 和 free 显示的内存使用情况。
答案1
我不确定你想要什么,但有几点建议:
cat /proc/meminfo
vmstat 1
答案2
从http://www.linuxforums.org/articles/using-top-more-efficiently_89.html:-
VIRT : Virtual Size of the task. This includes the size of process's executable binary, the data area and all the loaded shared libraries.
RES : The size of RAM currently consumed by the task. Swapped out portion of the task is not included.
SHR : Some memory areas could be shared between two or more task, this field reflects that shared areas. The example of shared area are shared library and SysV shared memory.
(根据错误答案编辑 - 感谢@mattdm)
答案3
Linux 内核正在将内存用作磁盘缓冲区。这是正常现象,无需担心。如果正在运行的进程需要内存,则会从缓冲区中提供内存。请查看linuxatemyram.com了解更多信息。