Linux环境清理缓存信息

1、查看当前内存使用情况

[root@VM-12-2-centos ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        4.1G        977M         67M         10G         10G
Swap:            0B          0B          0B

2、执行sync同步数据到硬盘

[root@VM-12-2-centos ~]# sync
[root@VM-12-2-centos ~]#

3、执行内存清理

[root@VM-12-2-centos ~]# echo 3 > /proc/sys/vm/drop_caches
[root@VM-12-2-centos ~]#

4、查看清理结果

[root@VM-12-2-centos ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        4.1G        977M         67M         10G         10G
Swap:            0B          0B          0B

你可能感兴趣的:(linux,运维)