logoalt Hacker News

mvanbaakyesterday at 4:56 PM3 repliesview on HN

> I chose to enable zram for swap

swap is used when you run out of ram. using a ramdisk for swap ... You see how that doesnt make sense?


Replies

marysol5today at 10:35 AM

It's more complicated than that, same as PAGING on Windows. It's about offloading some of the less accessed data from RAM onto slower hardware.

You can compress the swap, so you can squezze a bit more by using CPU in that tiny amount of read you do.

moebrownetoday at 8:44 AM

> swap is used when you run out of ram

This is not correct. Swap is not a RAM overflow.

> Swap is not generally about getting emergency memory, it's about making memory reclamation egalitarian and efficient. In fact, using it as "emergency memory" is generally actively harmful.

https://chrisdown.name/2018/01/02/in-defence-of-swap.html

schmeichelyesterday at 5:01 PM

Zram creates a compressed RAM disk. https://wiki.archlinux.org/title/Zram

show 1 reply