首页  

linux手工释放cache     所属分类 linux 浏览量 1207
# free -m
              total        used        free      shared  buff/cache   available
Mem:           1839         352          92           0        1394        1303
Swap:             0           0           0


1 查看当前drop_caches值
# cat /proc/sys/vm/drop_caches 
0

2 手动执行sync命令
  确保系统完整性,将所有未写的系统缓冲区写到磁盘中,
  包含已修改的i-node、已延迟的块I/O和读写映射文件
# sync

3 手动释放cache
#echo 3 > /proc/sys/vm/drop_caches

如果出现  权限不够 错误 使用以下命令

sudo sysctl -w vm.drop_caches=3


# free -m
              total        used        free      shared  buff/cache   available
Mem:           1839         352        1380           0         106        1354
Swap:             0           0           0



release pagecache
# echo 1 > /proc/sys/vm/drop_caches

release dentries and inodes
# echo 2 > /proc/sys/vm/drop_caches

relase pagecache, dentries and inodes
# echo 3 >/proc/sys/vm/drop_caches

上一篇     下一篇
利用shell命令分析java线程堆栈

软件架构设计几大原则

网页上显示html和xml代码的几种方法

如何让pre元素里的内容自动换行

jdk自带工具使用

找出最耗CPU的java线程和代码