One of my games actually freezes the whole system while loading this game. After some analysis, I saw the SWAP completely occupied. So I want to increase this SWAP size to at least 16 or 32 GB (8 GB is not enough for the game).
I could just go to Google and search for how to do that but… Since I use Fedora, I heard that :
Swap is useful, except when it’s slow. zram is a RAM drive that uses compression. Create a swap-on-zram during start-up. And no longer use swap partitions by default.
So does this means that the normal steps in distros like Ubuntu don’t work on Fedora because of this? If so, could you show me the steps since all of that is currently unclear to me.
I would advise against SWAP in any of the sizes requested as this will slow down your system; however, here are the commands anyway, they should work on Fedora although I have not tested.
Seems like Fedora uses ZRAM instead of SWAP and I find the solution for it.
Create a file named zram-generator.conf on the directory /etc/systemd
Copy/paste that (it’s my configuration, change it depending on what you want)
[zram0]
zram-fraction=2
max-zram-size=16192
zram-fraction seems to be a value, for example if the value is 1.X it means that the ZRAM will be equal to the amount of physical ram of your PC. If the value is 2.X, the ZRAM size will be the double of the physical RAM of your computer.
max-zram-size is actually the maximum ZRAM size you want.
So I won’t pretend to be anything close to an expert with respect to ZRAM, but my basic understanding is that ZRAM creates a swapfile in RAM.
If this is accurate (correct me if it isn’t), I don’t see how ZRAM could ever be larger in practice than the amount of physical memory you have (+ whatever the compression ratio is). In other words, it seems that if you use ZRAM the size of swap should be less than the amount of physical ram not more. If you are using swap to compensate for a shortage of RAM, it seems like ZRAM is likely not the best approach.
It seems to me that the best option in more ways tha none would be to add RAM if at all possible.