No swap, swap or swap with hibernate? And do you change the swappiness setting?
Whatever you want, but setup swap. Linux benefits generally from the existence of swap, used or not.
Make a swapfile and continue on with life.
For desktops, zram with no swapping to disk. Hasn’t given me any trouble yet, except for the rare news website (it’s always news websites) with a horrific memory leak.
For laptops, zram plus a low-priority swap file for suspend-then-hibernate. My old laptop drains a fair bit in sleep mode and my new one doesn’t have proper S3 suspend because microslop is pushing manufacturers to only support S0 idle.
Always a file, never a swap partition. Everything that can be encrypted lives inside the encrypted root partition.
i still make a swap partition (inside the encrypted volume group). if it’s used, great–if not, no big deal, as ssd should keep some empty bits anyway.
my lug has been trying to do a bunch of testing to figure out if we should recommend zswap cover zram, particularly for those with 16 GB or less on highly demanding games, or even in all cases. lots of distros default to a tiny pinch of zram nowadays
I use zram only with no swap on the SSD for my laptop/desktop.
For my server it has zram too but with extra low priority swap on the SSD just in case zram gets full up.
Hibernate isn’t something I’ve really ever used, my laptop uses very little power in sleep mode.
Depends on how much RAM you intend to use, and how much you need. For normal web browsing, I think probably enough swap space to make your total RAM + Swap amount up to 24GiB should do. If you have more than that and don’t run anything memory intensive, you can probably get away without any swap at all.
If you want the ability to hibernate though, you need at least the same amount of swap as physical RAM (since Linux will use the swap space as the location to “hibernate to”.
I think for an SSD it makes sense to use a swap file rather than a swap partition, since random access is basically free and you can resize it easily. That’s a minor thing though.
How much memory do you have? How much storage do you have? What will this computer be used for? Do you want to be able to hibernate?
I have learned about the existence of zram and zswap today, and added a higher priority RAM swap on my workstation to reduce swapping to SSD. Should speed things up even more.
On the fastest drive I have, longevity be dammed. I buy fast hardware because I want my computer to be fast - having my RAM (likely the fastest thing in the system) swap to a slow drive completely undermines that and defeats the purpose.
Hibernation I don’t normally mess with, and same with swappiness.
cat /proc/sys/vm/swappiness
Open /etc/sysctl.conf for editing:
sudo gedit /etc/sysctl.conf
Add vm.swappiness=10 at the end and save the file.
Reboot your system and check the swappiness value:
cat /proc/sys/vm/swappiness # 10




