[root@cdh-1 sbin]# free -g total used free shared buff/cache available Mem: 62 16 18 0 27 45 Swap: 15 0 15 [root@cdh-1 sbin]# cat /proc/vmstat | egrep "dirty|writeback" nr_dirty 62 nr_writeback 0 nr_writeback_temp 0 nr_dirty_threshold 3387573 nr_dirty_background_threshold 1129191 [root@cdh-1 sbin]# sysctl -w vm.swappiness=0 vm.swappiness = 0 [root@cdh-1 sbin]# echo "vm.swappiness = 0">> /etc/sysctl.conf [root@cdh-1 sbin]# swapoff -a [root@cdh-1 sbin]# free -g total used free shared buff/cache available Mem: 62 16 18 0 27 45 Swap: 0 0 0 [root@cdh-1 sbin]# sysctl -p vm.swappiness = 10 vm.swappiness = 0 [root@cdh-1 sbin]# free -g total used free shared buff/cache available Mem: 62 16 18 0 27 45 Swap: 0 0 0
第一部分Mem行解釋:
total: 內存總數;
used: 已經使用的內存數;
free: 空閑的內存數;
Buffers/cached: 磁盤緩存的大小。
關系: total = used + free +Buffers/cached