Understanding “Buffers” and “Cached” from free command

前端 未结 5 1216
独厮守ぢ
独厮守ぢ 2021-01-30 11:47

This has been asked earlier but don\'t want to update the same thread again as it was a old thread .

Want to clarify myself on the \"buffers\" and \"cache\" column from

5条回答
  •  春和景丽
    2021-01-30 12:12

    Linux vm sub-system treats any free or unused or non-allocated memory as buffers/cache

    Therefore, running echo 1 > /proc/sys/vm/drop_caches instructs the kernel to drop or clean the page caches (page-cache), dentries (slab-cache), and inodes (in the slab-cache) and causing the memory to become reclaimed and available.

    Clean data cache pages are not freed by design. They can be easily reclaimed by the kernel if or when extra memory is to be allocated (malloc/calloc/brk/sbrk and friends), while they contain useful data from disks that if needed again saves doing a disk I/O.

    sync command only commits any dirty pages in the memory to the disk, it does not free the buffers/cache. The only way to drop buffers/cache is by using echo "1" > /proc/sys/vm/drop_caches or the kernel reclaims the data pages for new allocated requested by applications

    pdflush has been replaced by using flushing threads per backing device info (BDI).

提交回复
热议问题