Linux 中的缓冲区和高速缓存有什么区别? [英] What is the difference between buffer and cache memory in Linux?
本文介绍了Linux 中的缓冲区和高速缓存有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不清楚这两个 Linux 内存概念之间的区别是什么:buffer
和 cache
.我已经通读了这篇文章,在我看来,它们之间的区别在于过期时间政策:
To me it's not clear what's the difference between the two Linux memory concepts : buffer
and cache
. I've read through this post and it seems to me that the difference between them is the expiration policy:
- 缓冲区的政策是先进先出
- 缓存的政策是最近最少使用.
我说得对吗?
特别是,我正在查看两个命令:free
和 vmstat
In particular, I'm looking at the two commands: free
and vmstat
james@utopia:~$ 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
5 0 0 173 67 912 0 0 19 59 75 1087 24 4 71 1
james@utopia:~$ free -m
total used free shared buffers cached
Mem: 2007 1834 172 0 67 914
-/+ buffers/cache: 853 1153
Swap: 2859 0 2859
推荐答案
缓冲区"表示 RAM 的多少部分专用于缓存磁盘块.Cached"和Buffers"类似,只是这次它缓存了文件读取的页面.
"Buffers" represent how much portion of RAM is dedicated to cache disk blocks. "Cached" is similar like "Buffers", only this time it caches pages from file reading.
引自:
这篇关于Linux 中的缓冲区和高速缓存有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文