# Page Cache
包含磁盘上块映射。
# Inode
表示文件的数据结构
# Dentries
表示目录的数据结构
清除Page Cache缓存:sync; echo 1 > /proc/sys/vm/drop_caches
清除Inode与Dentries缓存:sync; echo 2 > /proc/sys/vm/drop_caches
清除这三者的缓存:sync; echo 3 > /proc/sys/vm/drop_caches
free
可以用 free 或 vmstat,来观察页缓存的大小。free 输出的 Cache,是页缓存和可回收 Slab 缓存的和,
可以从 /proc/meminfo ,直接得到它们的大小:
$ cat /proc/meminfo | grep -E "SReclaimable|Cached" Cached: 748316 kB SwapCached: 0 kB SReclaimable: 179508 kB
参考文献
How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
what are pagecache, dentries, inodes?