I just installed Fedora Workstation 33 afresh last night with an ext4 partitioning scheme and discovered that zram was enabled by default. About 4GB of space was allocated to it, which is half the size of the physical memory my laptop has. I was furthermore surprised when I discovered the following.
Look at the swap bar of htop. Actually I allocated 1536MB of space for the designated swap partition and while installation, the zram got enabled as a new default and now I see them working together - hence resulting the 5.32GB of space that you see in the screenshot. Now that is definitely not a problem. The problem is even when I have reduced the swappiness value, the OS still finds reasons to make use of the swap space. I have at least half the memory left for use and then I feel the sluggishness in the interaction, so I quickly open up htop to see an active use of the swap partition.
Beginning to swap pages to back to the secondary memory and forth, even when almost half the physical memory is left unutilized is unsettling. It also messes up the experience as there’s a notable lag in the user interface. I am sure that my hardware is not the type where you would want to use swapping in the first place as I have only one 5600RPM 2.5" hard drive which is not a very fast disk, and the tendency of swapping every now and then bottlenecks the capability of how good the physical memory could have, otherwise, performed. I think that I have detected the symptoms right (Feel free to correct me if I have not).
I think you can uninstall the zram-generator package if you wish to disable zram, but note that the defaults are default for a reason… adding a traditional swap partition of any size creates potential for sluggish performance.
Edit the /etc/systemd/zram-generator.conf config file (read the comments).
sudo systemctl restart firstname.lastname@example.org
Check the new size
However, if you have zram and a swap partiton, zram has the priority over the disk based swap space.
I don’t know: if you suffer lags, I doubt that it is due to swap. You can try to temporarily disable disk based swap space using
And look if lags persist.
In addition, as far as I know (ooh well, I’m not an expert), swapping is not always triggered by a lack of free RAM.
Thank you for listing the steps @alciregi. I would follow them and see if the lag persists.
Exactly, @alciregi! Here’s the thing - there’s ample RAM left but still swapping is preferred even when I had reduced the swappiness value. What really troubles me is the greater inclination of using the swap than that of using the physical memory.