0

Possible Duplicate:
Linux memory: buffer vs cache

When using command like ps/free to monitor memory on a Linux box, we can see a statistic called buffered memory and another called cached memory. I have searched Internet but cannot find a consistent answer for their differences. Appreciate if anyone could give me any hints.

BTW: I am debugging a program's memory usage pattern, so understanding the concepts are useful for my development.

thanks in advance, Lin

Community
  • 1
  • 1
Lin Ma
  • 9,739
  • 32
  • 105
  • 175
  • I searched before asking this question. But I cannot find out what are exactly the differences between this statement -- "Buffers" represent how much portion of RAM is dedicated to cache disk block. "Cached" is similar like "Buffers", only this time it caches pages from file reading.". Any hints? – Lin Ma Dec 06 '12 at 16:28

1 Answers1

1

Buffers are the I/O buffers whereas cached is the page cache.

kjohri
  • 1,166
  • 11
  • 10
  • Hi @Karunesh, what are the differences between I/O buffer and page cache? Appreciate if you could show an example? – Lin Ma Dec 06 '12 at 17:12
  • 1
    Page cache is the cache of physical disk pages. It is used for file I/O. I/O buffers is a relatively smaller amount of memory used for input and output operations to devices. For example, the disk is also available as a block special file and one can manipulate a disk block at a time. – kjohri Dec 07 '12 at 06:38
  • Thanks @Karunesh. It seems both page cache and buffer could be used in file I/O? What are the differences? Appreciate if you could give more comments. – Lin Ma Dec 07 '12 at 07:22