I disable zram every time I install Fedora

ZRam
If you do a quick search online, you’ll find plenty of discussions where people ask about turning off zram—for one reason or another. They’re often met with a barrage of comments saying they’re making things worse. “Zram is free performance, didn’t you know? It costs nothing and doubles your RAM!”

Yeah, well—hear me out.

My desktop has 16 GB of RAM. I don’t even get close to running out of memory unless it’s been up for 30 days straight with 100 different apps or browser tabs open. My newer ThinkPad has 8 GB.

Now, 8 GB isn’t considered a large amount of memory anymore. In fact, people will tell you it’s rapidly becoming the bare minimum. But I’ll tell you this: for most people’s needs, especially on a laptop, it’s plenty. I don’t tend to have much open on my notebook—just a couple of browser windows, a few terminals, email, maybe a file manager. Any more than that and I start feeling lazy, because odds are I’m not really using all that stuff. I tend to be more focused when I close down things I’m not actively using.

Anyway, back on topic—why don’t I use zram?

My machines are all 8 years old, or older. They work just fine, but they are not new.

My desktop has a 4th-gen Intel chip, and my laptop runs a 5th-gen low-voltage i5. Zram does give you “more memory,” but it comes at a cost. It works by compressing unused memory pages, which means your CPU has to do that work. Every time a page is written to zram or read back out, it must be compressed or decompressed.

Whether or not that impact is that noticeable, I can’t say for sure—I haven’t run benchmarks. But I do know this: my machines are fast enough, and I like to keep them light, fast, and nimble. And since I already have enough RAM, it makes no sense for me to use zram. If I do need to swap, all of my systems have fast SSDs to handle swapping well enough. I typically allocate 1–4 GB of swap space, and I do that on the fastest SSD in the system.

If you’ve got multiple drives—say, NVMe, SATA SSD, and a spinning hard drive—only put your swap on the NVMe. Another tip: if you’re not planning to hibernate, there’s no reason to make your swap as large as your RAM. Swap is useful as a safety net so your system doesn’t lock up when you run out of memory, but in my experience, I’ve rarely used more than 1 GB. If you’re consistently using multiple gigabytes of swap, you probably just need more RAM.

Another argument I often see is: “Zram doesn’t consume extra memory.” Well… how does that make any sense? Of course it does. Sure, it’s compressed—maybe you use 500 MB of RAM for what would’ve been 1 GB of swap—but I’d rather use that 500 MB as actual RAM and just let the system swap to SSD.

If you want to disable zram on Fedora, just create an empty config file called zram-generator.conf and place it in /etc/systemd/.

You can even do this from the live installer, while it’s still copying data. Just pop open a terminal and run:

sudo touch /mnt/sysroot/etc/systemd/zram-generator.conf

 

That’s it!
© 2025 LostGeek.NET - All Rights Reserved. Powered by ClassicPress, NGINX, Debian GNU/Linux.