Top
Best
New

Posted by Ecno92 11 hours ago

Do not buy RAM, compress(curiousbits.nl)
185 points | 157 commentspage 2
bullish-bearr 25 minutes ago|
Doesn't this only work if you have a bunch of stuff you do not need to access frequently in RAM? i wonder what kind of algorithm optimization goes behind the scenes to make sure pages that least recently used get compressed with other pages
sammatilda 10 hours ago||
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.

hobo123 34 minutes ago||
Not hating on Fedora, but do you really want your dad on a distro that switches to new packages (or tries new stuff) very eagerly, and that basically requires you to update to the new version every time? Also, 16GB on Linux go a long way, unless you do mem intensive stuff.
mkesper 4 hours ago|||
zram has inherent problems and is superseded by zswap. https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-...
hofiflo 3 hours ago|||
I have a laptop with soldered RAM, a whole whopping 16GB of it. Without zswap or zram, it’s borderline unusable with web browsing, a bunch of terminals, mail client, etc. open. Maybe it’s a skill issue on my side, but only zram makes it work properly without hickups due to the OOM killer taking too long to kick in. Since switching from zswap to zram, I basically don’t encounter OOM situations and corresponding lockups anymore at all. Just my personal anecdote :)
adgjlsfhk1 2 hours ago||
zswap+earlyoom/systemd-oomd is the optimal combo. Unfortunately, very few desktops ship this/configure it correctly.
hofiflo 38 minutes ago||
I guess that’s where the skill issue is coming in! That’s what I tried but probably my configuration wasn’t ideal. Maybe I should give it another shot!
anthk 3 hours ago||||
Not in my case. Both a NUC with 8GB of RAM and a netbook with 1. Zram ran better. The least you touch the disk, the better.
kasabali 3 hours ago|||
superseded when? both have inherent problems and their usecases and I got sick of this meme of pushing zswap as the superior solution.
quotemstr 17 minutes ago||
Doesn't seem like a "meme" as much as a well-argued technical position. What's the problem?
nico 10 hours ago|||
Wow, very cool. Is this like the old "RAM doubler" for Mac OS (or like Johnny Mnemonic's "Pemex MemDoubler")? :)
Lio 9 hours ago|||
It's funny, I switch from Fedora back to Ubuntu last year.

I really like Fedora in that it seems very up to date package wise but I found it requires a reboot every time I update using the UI updater.

It's better using the dnf command but it still felt a bit lumpy compared to apt.

mritzmann 9 hours ago|||
Install "needrestart", and you'll see that a reboot would be useful in Ubuntu, too. Many running programs still use the old version of a shared library even after it has been updated. With so many security updates these days, it almost always makes sense to reboot.
nosrepa 1 hour ago|||
You can turn that off in the settings for discover.
amelius 8 hours ago|||
Could this be one of the tricks the M-series cpus are pulling behind the scenes to make them look faster?
swiftcoder 4 hours ago|||
It's nothing to do with the CPUs. Apple implemented this OS-wide back in the 2010s, long before the M-series was on anyone's radar.
jrmg 5 hours ago|||
It’s definitely one of the tricks the Neo is pulling behind the scenes to make 8Gb be ‘enough’.
speed_spread 9 hours ago||
I like Fedora too but I'm pretty sure Ubuntu also has zram. You just need to enable it.
Juvination 5 hours ago||
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.
myrandomcomment 4 hours ago||
MacOS does this by default for inactive pages. On my current system with 18GB of RAM I show 4.80GB for Apps, 3.16GB Wired and 5.06GB Compressed.
certyfreak 9 hours ago||
I switched to Fedora some time ago and only recently learned about zram. I was hitting full system memory(16GB) during normal use, and after increasing my zram to 16GB, I was blown away. I had initially planned to buy additional ram.
nukanse 8 hours ago||
For a programmer, on many cases, it pays to compress the data, to improve RAM IO, because the alu may already be doing nothing meanwhile waiting for the data from ram, so you can use that time to decompress, process, compress, and store the result. A lot of code today is bottlenecked by IO. You spend a lot of effort optimizing with SIMD, processing the data super fast, and then the speed it's wssted because there is not enough bandwidth to even send the result to ram. Modern cpu should include more hardware support for memory compression
Lerc 5 hours ago||
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.

anthk 3 hours ago|
Browsers can just suspend tabs. If they are separate processes, just send a SIGSTOP except for the actual active tab and run SIGCONT upon switching.
roosgit 11 hours ago||
MacOS has been doing this for quite a while now. I was a bit surprised this wasn’t the default for most Linux distros, although I think Pop!_OS (what a name!) has had zram enabled for a few years already. I turned it on on one of my servers (1GB RAM) and it works fine.
kachnuv_ocasek 10 hours ago||
Fedora has had zram on by default for at least five years now.
ChocolateGod 4 hours ago||
zram relies on the swap subsystem, macOS memory compression does not rely on pages being swapped.
anthk 3 hours ago||
You can enforce the swappiness to 100 and virtually work in the same way.
mrob 2 hours ago||
Maximum swappiness is 200. Setting it higher than 100 is possibly a good idea when using zram.
stepintodev 9 hours ago||
[dead]
aktenlage 8 hours ago||
So, if it is used as swap, that means to use the data, it first needs to go to the CPU, then back to regular RAM, then back to the CPU.

Isn't that wasteful? The CPU's caches may help a bit, but I would guess first a huge block is going through the decompression, so only the last bits are still in the cache, when the actual usage starts.

altcognito 4 hours ago|
It's funny that MS didn't integrate memory compression until 2015. From ye olden days, we used "RAM doublers" in MSDOS, which were a bit of a different beast and took a performance hit due to simpler implementation, so some of us aren't "excited" by the cost of packing things in with compression. It is a bandaid for processes that lie somewhere between being needed and not (otherwise it would goto swap right?)

If it avoids hitting the disk I get it, but to some of us, that just means it's time to buy more RAM

More comments...