linux内存管理命令
vmstat -s
与free -m 是比较好的观测内存的命令
刚进入运行的系统
-bash-3.2$ vmstat -s
30897940totalmemory
184408usedmemory
78848activememory
67432inactivememory
30713532freememory
6356buffermemory
105176swapcache
4192956totalswap
0usedswap
4192956freeswap
369non-niceusercputicks
0niceusercputicks
537systemcputicks
120270idlecputicks
1523IO-waitcputicks
4IRQcputicks
50softirqcputicks
0stolencputicks
112896pagespagedin
9724pagespagedout
0pagesswappedin
0pagesswappedout
160886interrupts
71964CPUcontextswitches
1350373112boottime
2821forks
[root@localhost~]#free-m
totalusedfreesharedbufferscached
Mem:301731792999406102
-/+buffers/cache:7030103
Swap: 4094 0 4094==========
运行很长时间,内存cach了很多
[root@localhost ssh]# vmstat -a 2
procs-----------memory-------------swap-------io------system-------cpu------
rbswpdfreeinactactivesisobiboincsussyidwast
00023590020534778016149480001100010000
0002359002053477721615016000410063060010000
0002359002053477721615012000010023010010000
00023589880534777216150120002410173840010000
root@localhostssh]#vmstat-s
30897940totalmemory
7302736usedmemory
1610636activememory
5346844inactivememory
23595204freememory
274844buffermemory
6102092swapcache
4192956totalswap
0usedswap
4192956freeswap
558515non-niceusercputicks
1193niceusercputicks
585088systemcputicks
2967723549idlecputicks
210472IO-waitcputicks
4406IRQcputicks
301885softirqcputicks
0stolencputicks
543204pagespagedin
41063536pagespagedout
0pagesswappedin
0pagesswappedout
3722943494interrupts
393601166CPUcontextswitches
1346660283boottime
8934193forks
[root@localhostssh]#vmstat
procs-----------memory-------------swap-------io------system-------cpu------
rbswpdfreebuffcachesisobiboincsussyidwast
0002359520427484861020600001100010000
[root@localhostssh]#free-m
totalusedfreesharedbufferscached
Mem:3017371312304202685958
-/+buffers/cache:90429269
Swap: 4094 0 4094