There is a lengthy thread on Reddit about the technical differences. Apparently Zswap will take advantage of the kernel eviction strategy for swap space. Apparently Zram doesn’t have that. To me that never made sense because, you create a Zram block device and then set that as your storage for swap space. Why would the kernel care, or know, that the swap space is backed by a Zram block device.
I do use Zram for my cloud self hosting machines and my dev machine. On the cloud devices they have 1 or 2 GB of ram and on my dev machine I have 32GB of ram. And in both cases it definitely seems like there is swap eviction. I also set the vm.swappiness to 180. Prior to Zram I would set my machines’ swappiness to 10. Swapping is highly encouraged on my machine.
But… Why? If ZRam uses RAM as compressed swap, what advantage does it have over just leaving that RAM available as shared memory? Do you have a specific process that is eating up non-shared? This might be of interest: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html
There is a lengthy thread on Reddit about the technical differences. Apparently Zswap will take advantage of the kernel eviction strategy for swap space. Apparently Zram doesn’t have that. To me that never made sense because, you create a Zram block device and then set that as your storage for swap space. Why would the kernel care, or know, that the swap space is backed by a Zram block device.
I do use Zram for my cloud self hosting machines and my dev machine. On the cloud devices they have 1 or 2 GB of ram and on my dev machine I have 32GB of ram. And in both cases it definitely seems like there is swap eviction. I also set the vm.swappiness to 180. Prior to Zram I would set my machines’ swappiness to 10. Swapping is highly encouraged on my machine.
Why not just set kernel swappiness to 1 and not do any of that?
Because I want to encourage more swapping, not less.
But… Why? If ZRam uses RAM as compressed swap, what advantage does it have over just leaving that RAM available as shared memory? Do you have a specific process that is eating up non-shared? This might be of interest: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html