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:
- buffer's policy is first-in, first-out
- cache's policy is Least Recently Used.
Am I right?
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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…