Linux 手动整理内存

1、将内存的数据写回硬盘

sync

2、清除缓存

echo 3 > /proc/sys/vm/drop_caches

完成!

drop_caches 的解释:

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.

相关推荐