首页 > 学院 > 开发设计 > 正文

Linux 释放没用的内存

2019-11-06 07:30:46
字体:
来源:转载
供稿:网友

Free up unused memory:[1][2]

sudo sysctl -w vm.drop_caches=3#This command will clear pagecache:/sbin/sysctl vm.drop_caches=1#To clear dentries and inodes you can use:/sbin/sysctl vm.drop_caches=2#To free memory of the all above use a following command:/sbin/sysctl vm.drop_caches=3

或者

sudo sync && echo 3 | sudo tee /PRoc/sys/vm/drop_caches

Check memory usage:[3]

free -m

例子输出

total used free shared buffers cachedMem: 15983 4957 11025 153 44 808-/+ buffers/cache: 4105 11877Swap: 16318 585 15733
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表