You could check out a third alternative, Zram.
There are probably other advantages, but I use it mainly because of the ease and simplicity. No need to mess around with partitions or swap files.
Thank you! I did not know about this possibility. one never stops learning this looks like a simple but effective solution to me
if i understand correctly i install zram after installation.
Yeah. You choose “no swap” during the EOS installation. When you’re up and running you just install the package and write the config, as described in the tutorial.
My main memory is 16gb like yours. I will definitely choose ‘no swap’ during installation. I then install zram
i just notice that the pc, as it is configured now, is completely busy as soon as i do any video editing with handbrake
now i use a swap partition with 8gb
Thanks for asking. I have to admit that I had started with zram alone and then later having added a swapfile. Now, when thinking deeper you might be right as zswap seems to be better when swapfile is used additionally.
Some people use zram in combination with disk-based swap, and some people use zram exclusively.
Personally, I’ve never encountered situations where disk based swap was needed beyond zram. If you encounter it, it should be easy enough to set up a swap file.
dmesg | grep swap
[ 0.191318] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[ 0.623013] zswap: loaded using pool lz4/z3fold
[ 10.654784] Adding 18874364k swap on /swap/swapfile. Priority:-2 extents:5 across:544473088k FS
I think my answer to my question above about getting information regarding zswap active settings and statistics seems to be reading /sys/module/zswap/parameters/* resp. /sys/kernel/debug/zswap/.
This means that if I want to have a command line interface I could write a script or program to deal with these directory contents.
I might be wrong but the way I understand zswap is that it isn’t really a swap “device” in the way a swap partition, a swap file or zram is. That might be the reason why it doesn’t show in swapon -s.
It is a kernel feature and is enabled by default so there is no need enabling it. However if one uses zram, it needs to be disabled.