alt.hn

4/19/2026 at 10:19:31 PM

Reminder: Enable ZRAM on your Linux system to optimize RAM usage

https://www.cnx-software.com/2026/04/15/reminder-enable-zram-on-your-linux-system-to-optimize-ram-usage/

by type0

4/19/2026 at 11:41:17 PM

There's also kernel zswap, right?

https://www.kernel.org/doc/html/latest/admin-guide/mm/zswap....

Oh right, definitely. Chrisdown wrote an article comparing the two:

https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-...

Zswap is supposed to degrade more gracefully.

There's even some HN comments on it:

https://news.ycombinator.com/item?id=47500746

by Kim_Bruning

4/20/2026 at 12:18:26 AM

My impression is that zswap will be the universally preferred option for compressed swap, but right now it doesn't work without disk swap behind it?

by yjftsjthsd-h

4/19/2026 at 11:56:18 PM

The architecture of zswap does make more sense, because you might as well combine the low speed and latency of compression with the same from writing to storage.

by dlcarrier

4/20/2026 at 12:17:17 AM

You only want to use zram if you've got no swap device (e.g. a raspberry pi).

If you do, you'll want zswap instead.

by ChocolateGod

4/20/2026 at 8:58:55 AM

What's old is new again: I remember various hacks like this being popular in early android ROMs because the first android phones really didn't have enough RAM to support the OS well.

by rcxdude

4/20/2026 at 9:30:30 AM

Asahi devs initially enabled ZRAM by default and then disabled it, now recommending against it, quoting instabilities and random weirdness.

by cromka

4/19/2026 at 11:49:03 PM

I've heard ZRAM mentioned before and I've just spent 5 minutes reading articles on it... Which is about the maximum I have time for these days when it comes to esoteric linux internals.

What's the downside? Does it use much CPU?

If I have enough RAM already, should I still enable it?

One article says it can be mapped to /tmp to reduce i/o. Is that a good idea?

This article is light on all of these kind of details.

by esperent

4/20/2026 at 1:42:24 AM

'Swapping' to ZRAM is far less painful than actual disk-backed swap. Sometimes I start wondering why the computer is a bit sluggish, and find that I've got several GB in ZRAM.

by BenjiWiebe

4/19/2026 at 11:25:50 PM

I remember that back in around 2007 i was able to somehow mount a graphical card (ati similar to geforce2?) memory directly in Linux, and put my swap file there :); Great times. Slackware 8.1 i think.

as for zram: somehow i dislike it. Nowdays ram is plenty and if not: better to have fast OOM than chug of death with swap.

I also remember running NetBSD 1.3.1 and Slackware 3 on 386SZ 26MHZ with 2 mb of ram (nowadays hard limit is 4mb to boot due the large memory pages on x86 afik)

by iberator

4/20/2026 at 12:07:01 AM

Much agreed. Early OOM is so much better for me than swap. I have 128G on my work laptop, 96 on my personal desktop. If it doesn't fit in that, it probably means I'd need a terabyte or infinite amount of swap and that's just nonsense.

by Neywiny

4/20/2026 at 12:59:28 AM

This reminds me of a question I answered on StackOverflow a long time ago. I pointed out the original question was asking the computer to allocate no less than 128 gigabytes of RAM. The poster refused to accept the answer because I "didn't solve the problem, only explained why the code did not work"

by sidewndr46

4/20/2026 at 1:53:18 AM

I mean I would indeed consider that a comment on the question rather than an answer. Unless the question was "why doesn't the work with less than 128GB of RAM?"

by Neywiny