This is an old desktop I use for some small self hosting services. I never use all my RAM and I don’t see any RAM spikes other than when I install/compile things which I haven’t done in months. I restarted the machine a couple of times, but the SWAP will eventually go right back up to 100%.

I have an Ubuntu server/yunohost setup and found: https://askubuntu.com/questions/157793/why-is-swap-being-used-even-though-i-have-plenty-of-free-ram

My cat /proc/sys/vm/swappiness value is indeed 60. Im not sure what would reduce the SWAP space usage.

Would changing this swappiness value help? Anyone come across this issue before?

EDIT: Found out what it is, its the matrix server that is running on the system. Its taking up a significant amount of swap. Found out via:

smem -s swap -r -p

turning that off, the system is now using 90% less SWAP. /opt/yunohost/matrix-synaps was the process.

  • WhyJiffie@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    2
    ·
    6 days ago

    “hey, this memory page is never used and this file block is used a lot, so I’m going to put the memory page on disk and the file block in memory and everything will be faster.”

    except when not, like when I just copied a multi GB file, it was cached in RAM to be not read again for long, but at least half of my running programs are swapped out. Additionally if swap is o SSD, it has put totally unnecessary wear into it by doing this

    • mlfh@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      10
      ·
      6 days ago

      That’s why you can adjust swappiness, or designate a different high-endurance storage device for it.

      • WhyJiffie@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        6 days ago

        my swappiness is 0. yet my swap usage isn’t. plenty of “available” memory (as in, multiple GB)

        or designate a different high-endurance storage device for it.

        good luck with that on a laptop. maybe the swapiness setting could just work sensibly

        • ferret@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 days ago

          “sensibly” “intuitively” and “performant” are all different objectives and I assure you kernel devs working on such a central subsystem are primarily optimizing for one.

          • WhyJiffie@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            4 days ago

            the meaning of zero really shouldn’t be an objective thing. it means: don’t do that

            the kernel is literally eating my soldered eMMC chip