• Supercrunchy@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      20 hours ago

      I like zram! It has pretty low overhead and usually compresses data quite well (~2/3x). I have it set to the size of my total ram and I can’t notice when it starts to kick in.

      Some small amount of swap is also nice to have, but it gets rarely used for me, because zram gets used first.

      One trick that might be useful is that you can create a normal swap file and enable swap to it in cases where you want more. For example recently I needed to load 64GB of data on a 32GB laptop, so I created a 64GB swap file on the filesystem and used swapon to enable it. (just disable it before hybernation if you use it!)

      It just takes a bit longer to run, but if you don’t need all the data loaded at once it’s much faster than moving the code on a more powerful pc (or fixing it)…