What is the difference between buffer and cache memory in Linux?

后端 未结 12 1290
慢半拍i
慢半拍i 2020-12-02 03:33

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

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 04:15

    Quote from the book: Introduction to Information Retrieval

    Cache

    We want to keep as much data as possible in memory, especially those data that we need to access frequently. We call the technique of keeping frequently used disk data in main memory caching.

    Buffer

    Operating systems generally read and write entire blocks. Thus, reading a single byte from disk can take as much time as reading the entire block. Block sizes of 8, 16, 32, and 64 kilobytes (KB) are common. We call the part of main memory where a block being read or written is stored a buffer.

提交回复
热议问题