3 ms·
> swap on zram If I'm going to use memory that I don't have as swap, I might as well just use no swap and take the OOM if I use too much memory.
by nubinetwork 3y ago
> swap on zram
If I'm going to use memory that I don't have as swap, I might as well just use no swap and take the OOM if I use too much memory.
- _piif 3y agoNot sure I understand. Zram allows you to store pages in a compressed fashion to memory to prevent or at least delay until the OOM kicks in and to keep hold of cached files for longer to prevent needless disk reads. Considering the tradeoff is a marginal amount of CPU resources it seems like free extra space and a no-brainer to enable if swap on disk isn't desired, at least in my mind. I remember having issues with system starvation if it started to make excessive use of zram but that has been pretty much levitated with the introduction of MGLRU.
- fruitreunion1 3y agoswap on zram is awesome, I get quite good ratios with zstd. Though its effectiveness will obviously depend on what's in memory. If it's a bunch of already compressed stuff then it won't get a good ratio on that.