this post was submitted on 06 Jul 2024
1 points (100.0% liked)

Linux

11118 readers
412 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
 

To be clear, I don't blame the poster of this comment at all for the content of their post โ€“ this is accepted as "common knowledge" by a lot of Linux sysadmins and is probably one of the most likely things that you will hear from one if you ask them to talk about swap. It is unfortunately also, however, a misunderstanding of the purpose and use of swap, especially on modern systems.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] SpaceCadet@feddit.nl 2 points 2 years ago

0 swap: which was pretty awful with constant unexpected system freezes/crashes

I've run Arch without swap for many years without issues. The key of course is that you need enough RAM for what you are trying to do with your computer.

There's no reason why a 32GB RAM + 0GB swap system should have more problems than a 16GB RAM + 16GB swap system with the same workload. If anything, the former is going to run much better.

swap file: finicky but doable

What is finicky about a swap file?

It's just this:

mkswap -U clear --size 4G --file /swapfile
swapon /swapfile

Done

If anything it's way easier to create a file in your filesystem than having to (re-)partition your drive to have a swap partition. Much more flexible too if you want to change your swap configuration in the future.