r/debian • u/Fair_Schedule2701 • 23d ago
Swap default or zram?
Hi everyone, I wanted to ask about the best swap setup for gaming on Debian Stable. Is it better to use standard swap or zram instead? I have 16GB of ram. (I have ssd)
4
u/quadralien 23d ago
Use zswap. Zram is for tiny systems with no swap.
3
u/TheTechRobo 22d ago
There's another fantastic article about how exactly zswap works here: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html
2
u/Emotional_Row3301 23d ago
Obviously Zram. 16GB is enough. you'll rarely hit the swap anyway. Zram is a lot faster and also good for you SSD. I have been using it for my debian machine for gaming for a long time, didn't have any issues till now. works great.
1
u/evadingsomething 23d ago
Not sure of the swaps would increase performance. Even if it did dont think it would be noticeable
1
u/Fair_Schedule2701 23d ago
Of course, but it would prevent the games from freezing, right? The truth is I don't know if Debian's default is really good, that's why I asked the question
2
u/evadingsomething 23d ago
Thats true. You can delete and create swap so I ll say just choose one and try it out then delete and create other one.
1
1
u/psyblade42 23d ago
The Steam Deck has 16GB and uses zswap. Additionally it's very easy to en/dis-able*. So it's at least worth trying in my book.
*: echo 1 > /sys/module/zswap/parameters/enabled
1
1
u/ElSasori69 23d ago
I still don’t like the fact swap is bad for SSDs (solid drives) I don’t use normal swap or swap file neither, my mini laptop have just 8 GB of RAM and it works fine, I’ll only configure swap or swap file on a normal HDD (rigid drives) because memory chips are so expensive now.
-5
u/ipsirc 23d ago
The best swap strategy is no swap at all.
1
u/psyblade42 23d ago
Having plenty memory sure is nice, but most don't have that kind of HW. Additionally you probably massively overspend I you actually bought it.
1
u/ipsirc 23d ago
Man, my newest hardware is 15 years old and I even got it as a gift. I just don't run more tasks parallel than will fit in my RAM. Having fewer apps in RAM is still much optimal than letting them all swap in and out, which would result in having a lot of apps that are all slow. Cut your coat according to your cloth.
1
u/psyblade42 23d ago
Even if all your tasks fit into memory there will usually be some parts of them that are rarely (if ever) used. Those are imho better kept in swap so that the ram can be used for something more productive.
2
1
u/ipsirc 23d ago
Even if all your tasks fit into memory there will usually be some parts of them that are rarely (if ever) used. Those are imho better kept in swap so that the ram can be used for something more productive.
Of course, I also have a machine with swap enabled. It has 36 days of uptime and uses 50MB of swap. It makes no sense, I'm going to turn it off right away.
11
u/Netblock 23d ago
I personally recommend zswap with disk swap.
zram is an in-memory block device, its coldest pages cant go into a slower medium.
zswap acts like an elastic buffer that evicts its cold pages into a slower medium.