linux top 和 free 命令及 buffer和 cache 區別

**cache是高速緩存,用於CPU和內存之間的緩衝 
**buffer是I/O緩存,用於內存和硬盤的緩衝*緩存

 buffer 與cache 的區別 
   A buffer is something that has yet to be 「written」 to disk. 
   A cache is something that has been 「read」 from the disk and stored for later use.bash

[root@server ~]# free -m
                    total       used       free     shared    buffers     cached
Mem:           249        163         86          0         10             94
-/+ buffers/cache:         58        191
Swap:          511          0          511.net

其中:code

[root@server ~]# free -m
      total  used  free   shared   buffers    cached
Mem:   249   163   86       0       10         94
-/+ buffers/cache: 58      191
Swap:  511    0    511
其中:
total 內存總數
used 已經使用的內存數
free 空閒的內存數
shared 多個進程共享的內存總額
buffers: Buffer Cache
cached: Page Cache
-buffers/cache 的內存數:used - buffers - cached
+buffers/cache 的內存數:free + buffers + cached
**可用的memory=free memory+buffers+cached**
相關文章
相關標籤/搜索