linux内存查看、清理、释放命令

echo 1 > /proc/sys/vm/drop_caches

清理前

# free -h

total used free shared buffers cached

Mem: 19G 19G 203M 1.1G 82M 17G

-/+ buffers/cache: 1.5G 18G

Swap: 23G 159M 23G

清理后

echo 1 > /proc/sys/vm/drop_caches

# free -h

total used free shared buffers cached

Mem: 19G 2.4G 17G 1.1G 680K 1.4G

-/+ buffers/cache: 1.1G 18G

Swap: 23G 163M 23G

查看内存条数命令:

dmidecode | grep -A16 “Memory Device$”

查看服务器内存槽数量及各内存条大小

linux

dmidecode | grep -A16 “Memory Device$”

esxi

vclient-主机-硬件状态