1、查询当前内存使用情况和释放缓存的参数

redismaster 10:29:24 [~] [root] free -m
total used free shared buffers cached
Mem: 7872 777 7095 0 117 435
-/+ buffers/cache: 223 7648
Swap: 16383 0 16383

查看释放缓存参数的命令,如下所示:

redismaster 10:29:27 [~] [root] cat /proc/sys/vm/drop_caches
0

2、使用sync命令,将系统缓存区中的脏数据写入磁盘中,包括已修改的i-node、已延迟的块I/O和读写映射文件,命令

redismaster 10:30:12 [~] [root] sync

3、配置文件/proc/sys/vm/drop_caches中记录了缓存释放的参数,命令

redismaster 10:30:44 [~] [root] echo 3 > /proc/sys/vm/drop_caches

4、不重启机器使配置改生效,命令

redismaster 10:32:20 [~] [root] sysctl -p
posted on 2015-06-12 10:35  hacker1394  阅读(329)  评论(0编辑  收藏  举报