怎样正确查看Linux VPS的内存占用情况

很多VPS用户在查看Linux操作系统的内存使用情况方面有误解,经常给朋友解释怎样看一个Linux VPS的内存使用情况,总结如下:

看内存最方便的命令是free -m,在我的VPS上运行,结果如下:

 

[root@host ~]# free -m
total       used       free     shared    buffers     cached
Mem:          1024       1005         19          0          9        782
-/+ buffers/cache:        212        811
Swap:          996          0        995
[root@host ~]#

[root@host ~]# free -m

total       used       free     shared    buffers     cached

Mem:          1024       1005         19          0          9        782

-/+ buffers/cache: