Linux人工清理内存cache
Posted mvpbang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux人工清理内存cache相关的知识,希望对你有一定的参考价值。
内存缓存的出现是解决,设备之间的读写速度的差异!
00、linux缓存解释
/proc/sys/vm/drop_caches (since Linux 2.6.16)
Writing to this file causes the kernel to drop clean caches,dentries and inodes from memory, causing that memory to become free
sync //fist act!!!
To free pagecache, use echo 1 > /proc/sys/vm/drop_caches;
to free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches;
to free pagecache, dentries and inodes, use echo 3 > /proc/sys/vm/drop_caches.
Because this is a non-destructive operation and dirty objects are not freeable, the user should run sync first.
以上是关于Linux人工清理内存cache的主要内容,如果未能解决你的问题,请参考以下文章