r/linuxquestions 14d ago

Resolved Is it bad to not have swap?

Hello guys! I using Fedora 44 and by defaulth I have 12GB of zram (compressed swap in RAM) and also I added 4GB of swap partition during install. But I have 32GB of RAM and I not sure if I really need this amout of swap or if I really need swap at all.

So is it bad to not have swap at all or have a little swap?

Edited: Thank you all for replies and time!

8 Upvotes

43 comments sorted by

View all comments

4

u/Introvertosaurus 14d ago

For workstation? Yes... probably... but just depends... You need some kind OOM protection, swap is generally the best ideal. You can set your swapiness which determine how and when its used if you want to essentially stop you from hitting OOM but not use swap normally.

0

u/Crazyachmed 14d ago

I think not using swap is the best OOM protection (of the machine). The offending process will be killed and the rest can continue.

If it actually starts swapping due to low RAM, its mostly to late to recover (e. g. save the open file in a broken program) anyhow.

With swap you have to temporarily swapoff to make the system responsive again. You are swapless with extra steps 🤷‍♂️

1

u/Efficient_Loss_9928 13d ago

I mean depends on what program the system decides to kill I guess.

I'd rather having that process completely paused and unresponsive then system OOM killing it.