linux环境清理内存

linux环境清理内存,第1张

linux环境清理内存

运行项目时,提示空间不够

INFO  [main] 2022-01-14 19:31:32,868 IndexSummaryManager.java:87 - Initializing index summary manager with a memory pool size of 95 MB and a resize interval of 60 minutes

进行内存清理,查看内存占用情况,选择释放buff/cache

在清理缓存前应该先

sync下(在清理缓存先要先把buffe中的数据先写入到硬盘中,sync命令)

echo 3 是清理所有缓存       /proc是一个虚拟文件系统

[root@localhost ~]# sync
[root@localhost ~]# echo 3 > /proc/sys/vm/drop_caches
[root@localhost ~]# cat /proc/sys/vm/drop_caches
3

 在此查看内存情况,发现缓存已被清理

[root@localhost ~]#  free -m
              total        used        free      shared  buff/cache   available
Mem:           7822        1358        6008         391         456        5895
Swap:          3967          28        3939

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5704465.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存