如何手清理linux内存

手册/FAQ (549) 2015-10-28 10:21:19

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.

 

THE END