[Share Experiences] 关闭Swap之后系统不再卡顿
Tofloor
poster avatar
a675977709
deepin
2022-12-30 21:41
Author

本机内存32G,长时间不关机的情况下使用过程中总是出现文件系统卡顿,程序卡顿偶然间尝试了下

swapoff -a && swapon -a

重置了下swap空间,然后swap一直保持100M以下,后续没有出现卡顿现象。

问题

如果内存足够大的情况下为了性能,是不是可以永久关闭swap?

Reply Favorite View the author
All Replies
liwl
deepin
2022-12-30 21:46
#1

Reply View the author
nero28
deepin
2022-12-30 22:12
#2

你这么大内存,不需要swap吧

Reply View the author
a675977709
deepin
2022-12-30 22:15
#3
nero28

你这么大内存,不需要swap吧

工作需要,可能同时需要开几个虚拟机,之前没关闭swap时重复开关几次虚拟机,就比较卡了。

Reply View the author
fanguanqun
deepin
2022-12-30 22:16
#4

建议设置swap的分区,否则内存一旦用完必定死机。而有swap的分区,就会有一个缓冲区,内存用完时系统会变卡。但好歹不死机,还能人工处理释放一些内存,使得系统恢复。

Reply View the author
DebuggerX
deepin
2022-12-30 22:29
#5

不用swap,很难用,内存不够的时候也不顶用,该卡死还是卡死。

需要的时候开一下zram就好了,比swap效果好得多。

Reply View the author
3***2@qq.com
deepin
2022-12-31 00:25
#6

有些软件需要swap,所以这个swap是不能完全去掉的,可以设置少一点

Reply View the author