Almost quit EOS because I forgot to set up a swap

Yes i get that it is helpful and sometimes needed but there are cases where it it doesn’t really affect daily use. But yes it can and does, and is a good idea to have some form and size of swap to alleviate any issues in that regard. I do agree that it makes sense to add some form of swap whether it be a swap partition, swap file or some other form.

Glad you saw the light! :+1:

:wink:

I only see a swap coming! Isn’t that a paddle board? :grimacing:

How did you get those numbers? It’s completely wrong, btw. :rofl:

You can use zswap as well.

The difference between zswap and zram is that the former, despite its name, is not a swap device, strictly speaking, but the latter is, despite its name.

zswap works with the backing of a proper swap device (partition or file) while zram doesn’t need such backing.

2 Likes

I’ll have to try it, thanks!

Is it okay to have both running? I have zswap running but was going to try zram and wondered if I needed to disable zswap first.

Funny thing, I thought I had setup zswap but I’m actually already using zram because I have the following file configured.
/etc/systemd/zram-generator.conf

I know that it was recommended to disable zswap if using zram. See:

However, I don’t find any reference to this in ArchWiki anymore.

1 Like

You don’t really need to setup zswap, as it is a kernel feature and enabled by default.
For it to work as intended, you would just need a swap partition or file.

1 Like

It’s still there:

https://wiki.archlinux.org/title/Zram#Usage_as_swap

Note:

  • If the related zswap kernel feature remains enabled, it will prevent zram from being used effectively. This is because zswap functions as a swap cache in front of zram, intercepting and compressing evicted memory pages before they can reach zram. Despite the output of zramctl(8), most of zswap is unused in this circumstance. Therefore, it’s recommended to permanently disable zswap using the kernel parameter or sysfs setting before starting.
2 Likes

Shame on me, I overlooked that :blush:

I’ll stick with zswap :smiley:

Make it right! If you think it you can do it. :rofl:

Edit: My belief is along the same lines as this >