Reinstall the os and forgot to install zram and I paid for it

top 33 comments

sorted by: hot top controversial new old
[–] 46 points 2 months ago (13 children)
  • [–] [S] 54 points 2 months ago* (10 children)

    Swap but better it behave mostly like actual ram and fast too, not as fast as actual ram but still way faster than swap I can open 5 browser tabs one of them playing a video while compiling a software I don't feel my system slow down at all

  • source
  • parent
  • hideshow 10 child comments
  • [–] 20 points 2 months ago (8 children)

    I always confuse ZRAM and ZSwap. From my understanding ZRAM is the better one and Zswap is kinda outmoded.

    It turns into a rabbit hole every time I gotta reference it! Lol

  • source
  • parent
  • hideshow 8 child comments
  • [–] 8 points 2 months ago (7 children)

    From my understanding, it's the opposite. Zswap is the better one since it has a ZRAM-like compressed section of RAM and disk-backed swap. That's definitely an oversimplification though.

    I agree it's confusing. I always look it up during setup so I know which one to use.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 1 point 2 months ago (6 children)

    There is a lengthy thread on Reddit about the technical differences. Apparently Zswap will take advantage of the kernel eviction strategy for swap space. Apparently Zram doesn't have that. To me that never made sense because, you create a Zram block device and then set that as your storage for swap space. Why would the kernel care, or know, that the swap space is backed by a Zram block device.

    I do use Zram for my cloud self hosting machines and my dev machine. On the cloud devices they have 1 or 2 GB of ram and on my dev machine I have 32GB of ram. And in both cases it definitely seems like there is swap eviction. I also set the vm.swappiness to 180. Prior to Zram I would set my machines' swappiness to 10. Swapping is highly encouraged on my machine.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 1 point 2 months ago (5 children)

    Why not just set kernel swappiness to 1 and not do any of that?

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 2 months ago (4 children)

    Because I want to encourage more swapping, not less.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 2 months ago* (3 children)

    But.. Why? If ZRam uses RAM as compressed swap, what advantage does it have over just leaving that RAM available as shared memory? Do you have a specific process that is eating up non-shared? This might be of interest: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 2 months ago (2 children)

    You get more ram for very little slow down, that also, would rarely be the bottleneck. For the servers, ram is a constraint, and it's all just selfhosting. I have a Raspberry Pi that I selfhost with, as well as a couple 10 dollar compute instances in the cloud. More ram is much better than the tiny slow down that might occur during compression or decompression. All my services are all still very snappy, even the mailserver. For my work, I bring up large docker sandboxes of services that I need running to test entire systems. In the past, I would just allocate 32GB to a swapfile. ZRam is way faster.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 2 months ago (1 child)

    But you also get that with shared memory in zswap, with all the other advantages. I'd really recommend reading the "Architectural differences" in the linked article from Chris Down, as he's way deeper into the kernel code than me, but the biggest problem in a setup like a small memory server is:

    • If you have a ZRAM device, and it fills up, more recently needed pages end up on the backup disk swap, because ZRAM has no way to move between swaps

    • Where zswap is built into the kernel memory management layer, so it can automatically decide which pages are cold and put them on disk, while keeping fresh ones in compressed RAM.

    I.E. in your use case, zswap is better, not even taking into account all the other details from Chris' article.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 months ago

    I looked at the article, same as the reddit thread, probably written by the same person. ZSWAP is just not necessary. ZRAM works and doesn't require disk space w/ 3:1 compression. If I was running out of swap, then yes, I would take a look at ZSWAP to improve my swap situation. It's just not a thing with ZRAM, not for many years.

    I.E. for my use cases, ZSWAP is irrelevant.

  • source
  • parent
  • [–] 7 points 2 months ago

    It's the opposite actually, in terms of implementation Zram is a hack, but it does have it's use case when your system load doesn't far exceed your total RAM, on the other hand swap is tightly integrated into the system and it's on it's way to implement "Virtual Swap" which is effectively Zram but not a hack, making it like a hundred times better, see This blogpost for a detailed explanation

  • source
  • parent
  • [–] 38 points 2 months ago (1 child)

    It's a Linux feature to compress some of your memory and then store it in a RAM disk. For systems with limited memory, it makes it go further.

    https://en.wikipedia.org/wiki/Zram

    zram, formerly called compcache, is a Linux kernel module for creating a compressed block device in RAM, i.e. a RAM disk with on-the-fly disk compression. The block device created with zram can then be used for swap or as a general-purpose RAM disk. The two most common uses for zram are for the storage of temporary files (/tmp) and as a swap device.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 7 points 2 months ago* (last edited 2 months ago)

    I have a mini PC that has been barreling through NVMe disks but Alpine Linux’ β€œusb” install mode just wasn’t great either. So I use a β€œsys” install mode (traditional) on an NVMe disk but have directories like /var/log, /tmp, etc. mounted as zram disks with Zstandard compression. It’s been pretty fantastic honestly.

  • source
  • parent
  • [–] 20 points 2 months ago (4 children)

    Look at Mr. Fancy pants over here with 11 cores.

    I'm just jealous

  • source
  • hideshow 4 child comments
  • [–] 19 points 2 months ago (8 children)
  • [–] 43 points 2 months ago (7 children)

    I upgraded to 64GB RAM a year or so ago which I didn't really need, but it was cheap so why not.

    How things have changed.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 9 points 2 months ago (4 children)

    It didn't suck enough already buying PC parts in Australia?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 9 points 2 months ago (3 children)

    Now it's starting to look like upgrades are just a thing of the past and this is going to be my forever machine.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 5 points 2 months ago (2 children)
  • [–] 3 points 2 months ago

    I hope I am too, but I just looked at what a CPU, motherboard and RAM upgrade would cost and it looks like this system will be old enough to start high school by the time I replace it.

    And the system after that? If I buy new in 2030, when will the one after that be? 2045?

  • source
  • parent
  • [–] 1 point 2 months ago

    I think things are going to change. Apple is talking about buying ram from Chinese ram companies. If that happens, a lot of other companies will do the same and that should reduce pressure on ram quite a bit. I'm sure those long term contracts the AI companies have for expensive ass ram will get canceled quick.

  • source
  • parent
  • [–] 6 points 2 months ago (1 child)

    Dummy question… if you have an ssd, why not swap? Sure not the best but also that is the last resort and on ssd Is not as bad as it used to be on hdd

  • source
  • hideshow 1 child comment
  • Have you tried downloading more RAM?

  • source
  • [–] 2 points 2 months ago

    Is it just me or building with

    cmake --build --parallel
    

    Crashes with out of memory every time? Maybe it depends on the project but idk

  • source
  • [–] 2 points 2 months ago

    Still get that issue with swap and whatever zthing I use

  • source