Swapfile vs zram/zswap

I installed Yunohost without a swap partition, and for a long time, I’ve had the “system doesn’t have swap” warning in Diagnosis. Until now, it hasn’t caused issues, but I’m starting to see periods where only ~10% of RAM remains free, so I’m looking into my options, which are:

  • Swapfile (discussed a few times on the forum)
  • zram
  • zswap

The Debian Swap docs mention zram/zswap as alternatives in the intro, but I haven’t seen much discussion about them here.

  1. Is there general guidance for adding swap when a partition isn’t an option?
  2. Would you recommend starting with zram, or is a swapfile the safer bet?
  3. Are there any performance trade-offs I should consider?