在 Centos linux 6.3 上,我运行 free -m,它显示几乎所有 2g 已使用
注意:缓冲区/缓存非常小
[root@nsdlicense ops]# free -m
total used free shared buffers cached
Mem: 1877 1736 141 0 6 23
-/+ buffers/cache: 1706 170
Swap: 0 0 0
但同时在top中输入MI看不到任何进程使用所有这些内存:
top - 09:45:01 up 1 day, 23:59, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 112 total, 2 running, 110 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.8%us, 1.5%sy, 0.0%ni, 96.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1922620k total, 1778904k used, 143716k free, 6900k buffers
Swap: 0k total, 0k used, 0k free, 23564k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2639 apache 20 0 1722m 265m 3588 S 0.0 14.1 2:20.72 httpd
6246 apache 20 0 1530m 56m 3576 S 0.0 3.0 2:40.17 httpd
2564 apache 20 0 1530m 42m 3616 S 0.3 2.3 1:35.79 httpd
1641 mysql 20 0 818m 31m 2448 S 0.0 1.7 8:54.25 mysqld
8895 apache 20 0 881m 29m 6496 S 0.0 1.6 0:25.66 httpd
27060 root 20 0 28824 3052 2240 S 0.3 0.2 0:03.14 sshd
21110 root 20 0 28716 2836 2176 S 0.0 0.1 0:00.12 sshd
27460 root 20 0 28444 2692 2176 S 0.0 0.1 0:00.04 sshd
1179 root 20 0 165m 2004 1132 S 0.0 0.1 2:30.19 vmtoolsd
27062 root 20 0 105m 1996 1536 S 0.0 0.1 0:00.08 bash
27075 root 20 0 105m 1984 1544 S 0.0 0.1 0:00.00 bash
1312 root 20 0 88788 1956 488 S 0.0 0.1 0:16.80 httpd
27468 root 20 0 27732 1776 1352 S 0.0 0.1 0:00.00 sftp-server
21133 root 20 0 27732 1708 1236 S 0.0 0.1 0:00.00 sftp-server
21127 root 20 0 27732 1684 1236 S 0.0 0.1 0:00.02 sftp-server
21114 root 20 0 27732 1636 1236 S 0.0 0.1 0:00.02 sftp-server
我也尝试过这个ps内存脚本但它只显示正在使用大约 430MB 内存。
[root@nsdlicense ops]# ./ps_mem.py
Private + Shared = RAM used Program
96.0 KiB + 48.0 KiB = 144.0 KiB sleep
264.0 KiB + 15.5 KiB = 279.5 KiB mysqld_safe
316.0 KiB + 30.5 KiB = 346.5 KiB auditd
332.0 KiB + 23.0 KiB = 355.0 KiB init
496.0 KiB + 51.0 KiB = 547.0 KiB mingetty (6)
508.0 KiB + 97.0 KiB = 605.0 KiB top
632.0 KiB + 36.5 KiB = 668.5 KiB crond
292.0 KiB + 615.5 KiB = 907.5 KiB udevd (3)
1.2 MiB + 49.0 KiB = 1.3 MiB rsyslogd
1.6 MiB + 86.0 KiB = 1.6 MiB vmtoolsd
1.2 MiB + 935.5 KiB = 2.1 MiB bash (3)
2.4 MiB + 1.2 MiB = 3.6 MiB sshd (4)
4.7 MiB + 1.1 MiB = 5.8 MiB sftp-server (12)
31.4 MiB + 128.0 KiB = 31.5 MiB mysqld
375.6 MiB + 5.0 MiB = 380.5 MiB httpd (5)
---------------------------------
430.2 MiB
=================================