我的内存几乎已经满了,没有任何使用它的过程。
也许你认为这是一个重复的问题,但不同于其他人,我也使用了我的-/+ buffers/cache 。 这是相关命令的输出:
top - 00:27:38 up 2 days, 21:54, 1 user, load average: 0.07, 0.05, 0.05 Tasks: 90 total, 1 running, 89 sleeping, 0 stopped, 0 zombie Cpu(s): 0.3%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1020116k total, 882460k used, 137656k free, 11868k buffers Swap: 2064380k total, 22528k used, 2041852k free, 137824k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 15249 root 20 0 15024 1284 984 R 0.3 0.1 0:00.04 top 1 root 20 0 19360 712 500 S 0.0 0.1 0:06.88 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 4 root 20 0 0 0 0 S 0.0 0.0 0:01.85 ksoftirqd/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 stopper/0 6 root RT 0 0 0 0 S 0.0 0.0 0:01.19 watchdog/0 7 root 20 0 0 0 0 S 0.0 0.0 0:18.39 events/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events/0 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_long/0 10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 events_power_ef 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup 12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper 13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr 15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm 16 root 20 0 0 0 0 S 0.0 0.0 0:00.76 sync_supers 17 root 20 0 0 0 0 S 0.0 0.0 0:00.62 bdi-default 18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0 19 root 20 0 0 0 0 S 0.0 0.0 0:01.59 kblockd/0 20 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kacpid 21 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kacpi_notify 22 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kacpi_hotplug 23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ata_aux 24 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ata_sff/0 25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksuspend_usbd 26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khubd 27 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kseriod 28 root 20 0 0 0 0 S 0.0 0.0 0:00.00 md/0 29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 md_misc/0 30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 linkwatch 32 root 20 0 0 0 0 S 0.0 0.0 0:00.06 khungtaskd 33 root 20 0 0 0 0 S 0.0 0.0 0:24.98 kswapd0 34 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd 35 root 39 19 0 0 0 S 0.0 0.0 0:09.29 khugepaged 36 root 20 0 0 0 0 S 0.0 0.0 0:00.00 aio/0 37 root 20 0 0 0 0 S 0.0 0.0 0:00.00 crypto/0 44 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthrotld/0 45 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pciehpd 47 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kpsmoused 48 root 20 0 0 0 0 S 0.0 0.0 0:00.00 usbhid_resumer 49 root 20 0 0 0 0 S 0.0 0.0 0:00.00 deferwq 82 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdmremove 83 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kstriped
和
# free -m: total used free shared buffers cached Mem: 996 861 134 0 11 134 -/+ buffers/cache: 715 280 Swap: 2015 22 1993
和
root@reverser ~]# ps_mem Private + Shared = RAM used Program 4.0 KiB + 31.5 KiB = 35.5 KiB dbus-daemon 4.0 KiB + 56.5 KiB = 60.5 KiB vsftpd 84.0 KiB + 28.0 KiB = 112.0 KiB anvil 36.0 KiB + 86.5 KiB = 122.5 KiB udevd (3) 24.0 KiB + 99.0 KiB = 123.0 KiB mingetty (6) 116.0 KiB + 31.5 KiB = 147.5 KiB dovecot 128.0 KiB + 29.0 KiB = 157.0 KiB log 132.0 KiB + 39.0 KiB = 171.0 KiB crond 124.0 KiB + 104.0 KiB = 228.0 KiB exim 224.0 KiB + 37.0 KiB = 261.0 KiB auditd 324.0 KiB + 45.0 KiB = 369.0 KiB init 392.0 KiB + 205.0 KiB = 597.0 KiB fail2ban-server 716.0 KiB + 48.5 KiB = 764.5 KiB rsyslogd 452.0 KiB + 353.0 KiB = 805.0 KiB nginx (4) 968.0 KiB + 84.0 KiB = 1.0 MiB bash 1.5 MiB + 313.0 KiB = 1.8 MiB sshd (2) 1.7 MiB + 395.5 KiB = 2.1 MiB vesta-nginx (2) 2.1 MiB + 1.8 MiB = 3.9 MiB vesta-php (3) 7.5 MiB + 91.0 KiB = 7.6 MiB named --------------------------------- 20.3 MiB =================================
我应该怎么做才能减less内存使用量?
这看起来像内存膨胀是活跃的。 当pipe理程序受到内存压力时会发生这种情况; 它声称一些客人没有使用的记忆分配给其他人。 一般来说,当客人要求回来时,内存会自动返回。
VPS供应商通常会在资源过度使用时看到这一点,他们知道大多数用户不会使用分配给他们的所有RAM,CPU,磁盘等。
不幸的是,很难在VMware下探测客人的膨胀(其他一些虚拟机pipe理程序有方法让客人可以直接计算膨胀)。 但是你可以尝试启动一个使用大量RAM的程序; 如果启动成功,并且您的free数字没有像实际使用的RAM那样上升,那么您已经检测到将RAM释放回您的VPS的气球驱动程序。