Should bazzite use zswap instead of zram?

If in doubt, prefer to use zswap. Only use zram if you have a highly specific reason to.

This is really needed.

ZRAM, while it’s fine for really light workloads, starts to crumble as soon as it’s full. This makes 4Gb systems unusable with anything more than a web browser open.

Zswap provides the same advantages of ZRAM (compressed memory), while still being able to use disk based swap when RAM is full.

See this for more informations : Our swap situation isn't ideal (#552) Β· Issues Β· KDE Linux / KDE Linux Β· GitLab

from the article, it sounds like there are some design factors in Fedora / RedHat that are higher priority than the performance ramifications of zram, and of course it’s fine for folks to have differing priorities

but a gaming-oriented distribution probably does prioritise performance

@pauldoo shared instructions for switching from zram to zswap here: [Bug Report] Bazzite does not handle OOM properly - #10 by pauldoo

SteamOS uses zram, not zswap. We will switch if they do, otherwise we aren’t interested.

4GB is not a capable gaming machine by any modern standard. We cannot make decisions that harm other devices to benefit those.

gotcha, yep, following SteamOS makes sense given Bazzite’s goals, thanks

Just switch it to zswap yourself if you feel you need it, I have a script that does this for the AMD Based BC250 as its 100% needed on that system, as it suffers from ram related game crashing, 99% of modern systems it doesn’t matter, but saying this, 4GB must be tough, 8GB system ram with a 4GB GPU has to be the baseline today, and even that would be a real struggle fest.

I feel even on machines like the BC250, like the Steam Deck and other 16GB game consoles based on the Z1 Extreme, don’t seem to have any issues with zram at all, memory management seems to just work, but an odd ball like the BC250, even though its very much like those APU’s and has 16GB of shared ram, seems to have lots of memory management issues, and is one of the only situations I have come across that actually needs zswap in order to not crash on many titles.

If you want to switch over to zswap, then you can run use lines 25 through top 42 in my setup script here:

Just adjust the amount you want to allocate to zswap on line 36.

The compression algorithm my script switches you too is also less taxing on low end systems, which I will assume you have.

You can check what type of swap setup your running by using this command: swapon --show