Swap isn’t unlimited, it just delays the inevitable and makes everything slow while doing it. A 4GB swap partition isn’t going to save you if you run your 32GB computer out of memory.
It does help. It gives time for the kernel in this situation and also helps in general by allowing to defragment memory. You want to keep a small amount of swap space at all times.
Unless it's some sort of autonomous safety-related process, It's usually better for the process to die so I can just restart it.
Even if it was some sort of safety-related process that had to keep running no matter what, I would probably try to define/control the memory usage better so it wouldn't unexpectedly run orders of magnitude slower.
Uhm, no.
Anything what would request memory would just outright die, including even the most basic services.
Source: actually had a system without swap what would just die running `dnf update`. Or quietly die in a week or so if left unattended.
Swap isn’t unlimited, it just delays the inevitable and makes everything slow while doing it. A 4GB swap partition isn’t going to save you if you run your 32GB computer out of memory.
Who the hell would set 4Gb swap for a 32Gb RAM machine in 2025?
A guy with a decade old 64Gb SSD as the only drive in the system?
> and makes everything slow while doing it
It was so when the OS was on a HDD. Nowadays it's a PCIe device with 1 million IOPS.
And five years ago fans of some fruit company run around singing praises on how good their brand new laptops worked with a mere 8Gb of RAM.
It does help. It gives time for the kernel in this situation and also helps in general by allowing to defragment memory. You want to keep a small amount of swap space at all times.
Unless it's some sort of autonomous safety-related process, It's usually better for the process to die so I can just restart it.
Even if it was some sort of safety-related process that had to keep running no matter what, I would probably try to define/control the memory usage better so it wouldn't unexpectedly run orders of magnitude slower.
Programs, including the kernel
I've never had that happen. It usually just kills user-space programs