Hello, I came across zram recently and I’d like to know if I should use it, my laptop only has ~4GB of ram, and for the most part it’ll only stutter when I open multiple programs or a game, so would zram be adequate in my case?

Also, would the compressing and decompressing have a significant impact on my cpu?

    • DasFaultier@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      ·
      5 months ago

      This. I’ve had nothing but great experiences with zram on resource constrained VMs in an enterprise grade cluster.

  • f00f/eris@startrek.website
    link
    fedilink
    English
    arrow-up
    9
    ·
    5 months ago

    The major tradeoff with zRAM is that programs are much more likely to crash due to running out of memory, but will run faster when memory is running low and freezes are less likely. You can think of it as offloading the pressure that traditional swap puts onto your disk, onto the (much faster) CPU. There will be an impact on CPU usage, but not enough to cause noticeable slowdown; in my experience running Linux, the CPU is almost never the reason something is slow, and is only going to be under significant pressure if you’re running a 3D game in software rendering, compiling a large program, or another complex CPU-bound task.

    I wouldn’t recommend making the switch unless you often encounter system freezes or slowness while running tasks that use a lot of RAM (like web browsing on certain sites, or gaming), but it will improve things in that case.

  • HarriPotero@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 months ago

    zram is only suitable if you have no swap. I’d you have swap, zswap does a better job. It also compresses pages in memory, but swaps the least recently used pages to disk when pressured.