Linux users can squeeze 3.35x more memory out of their RAM with zram
Do not buy RAM, compress

AI workloads and dozens of browser tabs are pushing workstations to their memory limits, and RAM upgrades are costly or impossible. The author shows how zram compresses memory on Linux, turning 1.7 GB of physical RAM into 5.7 GB of effective capacity—a 3.35x ratio—for a small CPU cost. Fedora and Pop!_OS enable it by default; Ubuntu does not. The same trick could have halved the author's cloud bills.
5.7G of data in 1.7G of RAM. That’s a compression ratio of 1:3.35.
- varenc
As others have said, macOS does this by default and it's quite impressive. I have a long running daemon with a memory leak. By its nature, the leaking memory is very repetitive and easily compressed. Right now this daemon has tried to claim 2.5GB of memory, but it's been compressed to a mere 450MB of actual memory! And because it's a memory leak, it never accesses this old stuff, so it never gets decompressed. Only 20MB of RAM is held that isn't compressed.
Of course, it would be far better to just not have the memory leak...but in the mean time, macOS memory compression is making the leak nearly a none issue.
- hedgehog
As others have noted zswap is usually a better choice than zram, additionally depending on your situation it may be worth checking which algorithm it's using as there are a few choices (zstd, lz4, etc) because the defaults vary by distro. zstd is the right choice IMO unless you're in a situation where you know better.
- Lio
RAM compression sounds very useful but the thing I really need extra RAM for is local inference.
Since the models are effectively highly compressed data already my assumption is that RAM compression won't help improve that much (I'm assuming unified memory here as per the Framework Desktop). A bit like trying to compress a JPEG in a zip file.
Could anyone comment on that?
- jakozaur
> Memory compression is not new. If you have a Windows or Mac device you are already using it.
Yes, macOS has had it enabled by default since OS X Mavericks 10.9, released in October 2013. I’m surprised some desktop Linux distributions still require manual configuration to enable it.
For browser tabs, though, I think a better solution is automatic tab closing, using something like the Tab Wrangler extension for Chrome. Collecting tabs comes naturally; we’re much worse at closing them.
- cogman10
Don't use Zram, use Zswap. Especially if you want to swap to disk.
https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-...
- Juvination
What a fun loop through time. I remember downloading programs to free up ram in the early 2000's, then as RAM became more ubiqutous and programs were still small you could run them directly on RAMDisk. (I did this with Path of Exile about 10 years ago to avoid lag.) Now we are working back to getting the most out of our ram.
- Lerc
I have to wonder if the better solution would be for browsers (and apps that are effectively broswers) to compress their data proactively.
I find that the ratio of browserish memory use to that of other programs is enough to render the latter insignificant most of the time.
- sammatilda
I just discovered zram thanks to claude after installing fedora on a new computer and man I was blown away by both zram and fedora. Fedora amongst the linux distributions for some reasons has really got everything that an end user needs and the whole experience is just way smoother than anything I have used in 25 years on linux.
I am hoping to switch my dad from ubuntu to fedora in a month or so because he has 16 GB ram and this seems like something most people dont know.