除了top之外,vmstat也可以查看系统的一些信息
nasri@ubuntu:~$ vmstat -S M
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
2 0 0 901 56 552 0 0 574 18 84 329 4 3 94 0 0
nasri@ubuntu:~$
nasri@ubuntu:~$ vmstat 2 5 -S M
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 603 165 672 0 0 496 87 95 296 4 3 93 0 0
0 0 0 603 165 672 0 0 0 2 89 205 2 1 97 0 0
0 0 0 603 165 672 0 0 0 0 63 155 2 1 97 0 0
0 0 0 603 165 672 0 0 0 0 246 337 7 1 92 0 0
1 0 0 603 165 672 0 0 0 0 110 175 2 1 97 0 0
nasri@ubuntu:~$
vmstat 2 5表示每2s 采样一次数据,持续5次
free是指空闲的物理内存大小
buf用作磁盘缓存的内存大小
cs 每秒的上下文切换数量
可以用这个查看下之前布的fota程序的内存泄漏的情况唉