技术解析
top - 20:14:48 up 3:50, 14 users, load average: 0.11, 0.07, 0.01
Tasks: 271 total, 1 running, 270 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 29219.0 total, 11881.2 free, 15466.7 used, 1871.1 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 13315.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22408 fancy 20 0 1939288 1.3g 27236 S 0.0 4.7 0:54.23 node
24540 fancy 20 0 1796316 1.2g 26852 S 0.0 4.2 0:35.77 node
26340 fancy 20 0 1701084 1.1g 26816 S 0.0 3.9 0:23.76 node
23238 fancy 20 0 1799560 977.2m 28864 S 0.0 3.3 3:33.66 node
31380 fancy 20 0 1398740 859612 26588 S 0.0 2.9 0:22.56 node
24790 fancy 20 0 1462860 300348 34624 S 1.0 1.0 1:39.24 node
9485 systemd+ 20 0 1312000 207576 19056 S 0.0 0.7 0:11.86 mysqld
963 Debian-+ 20 0 3837356 196252 93012 S 0.0 0.7 0:32.77 gnome-shell
23193 fancy 20 0 1002800 180660 27656 S 0.0 0.6 0:05.43 gulp serve
9028 root 20 0 2638748 126656 47920 S 0.3 0.4 1:33.09 dockerd
9613 root 20 0 836084 117188 27760 S 0.0 0.4 0:02.63 node
24551 fancy 20 0 662480 103232 26836 S 0.0 0.3 0:11.79 node
31391 fancy 20 0 665040 96780 26580 S 0.0 0.3 0:06.74 node
26351 fancy 20 0 658384 90828 26800 S 0.3 0.3 0:08.92 node
22419 fancy 20 0 657872 89828 26852 S 0.3 0.3 0:11.09 node
22389 fancy 20 0 695392 79676 28204 S 0.0 0.3 0:09.40 node
10265 root 20 0 563444 76636 64800 S 0.0 0.3 0:00.89 chrome
24378 fancy 20 0 624668 71208 27944 S 0.0 0.2 0:09.08 node
30433 fancy 20 0 623132 68656 28088 S 0.3 0.2 0:06.28 node
26321 fancy 20 0 624668 68288 28136 S 0.3 0.2 0:07.36 node
10328 root 20 0 4724840 63104 50104 S 0.0 0.2 0:00.07 chrome
10310 root 20 0 479184 57416 47052 S 0.0 0.2 0:00.06 chrome
871 root 20 0 1999352 55604 22584 S 0.3 0.2 0:31.49 containerd
1175 Debian-+ 20 0 1886872 54284 40392 S 0.0 0.2 0:00.14 gsd-media-keys
1179 Debian-+ 20 0 1326184 52356 38780 S 0.0 0.2 0:00.17 gsd-power
1209 Debian-+ 20 0 1251796 51872 38440 S 0.0 0.2 0:00.13 gsd-wacom
> free -m
total used free shared buff/cache available
Mem: 29218 15468 11879 17 1871 13313
Swap: 0 0 0
以上是 top 和 free 命令的输出,可以看到 used 内存有 15G,top 命令中可以看到所有进程的 res 加起来也不到 6G,那么其他内存去哪了呢? buff/cache 也只有 1G 多。
PS: 这个机器是一个 KVM 虚拟机