Linux中的缓冲存储器和缓存存储器有什么区别? [英] What is the difference between buffer and cache memory in Linux?
本文介绍了Linux中的缓冲存储器和缓存存储器有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对我来说,尚不清楚两个Linux内存概念:缓冲区
和缓存
有什么区别。我已经阅读了这篇文章,在我看来,它们之间的区别是到期时间策略:
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:
- 缓冲区的策略为先进先出
- 缓存的策略为最近最少使用。
我正确吗?
特别是,我正在查看以下两个命令:免费
和 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的多少部分专用于缓存磁盘块。
"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.
quote from:
quote from:
- https://web.archive.org/web/20110207101856/http://www.linuxforums.org/articles/using-top-more-efficiently_89.html
这篇关于Linux中的缓冲存储器和缓存存储器有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文