Credit to @ryanc@infosec.exchange

I just did the graphic

you are viewing a single comment's thread
view the rest of the comments
[–] 8 points 2 weeks ago (9 children)

Can anyone tell me why I see swap usage with 10+GB of free RAM available?

  • source
  • hideshow 9 child comments
  • [–] 12 points 2 weeks ago (5 children)

    Saving ram to swap can be done with minimal impact. Helpful when you run out of memory and that 2gb app idling can be dumped right away instead of waiting for it to be copied to swap.

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

    but that's not what's happening. processes do actually get removed from RAM, and when they are needed they are very slow until they are loaded back. the system thinks it's more valuable to have that memory be filesystem cache

  • source
  • parent
  • hideshow 4 child comments
  • [–] -1 points 2 weeks ago (3 children)

    If true then Linux is a decade behind windows and macOS.

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

    tbh windows was doing this very aggressively on my system, it was swapping like a mad man right when memory usage reached 50%

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 weeks ago* (last edited 1 week ago)

    If you(or your distro) use zram then the zram usage may also count as swap in resource monitors. For me this was the case when i saw swap usage where it is clearly not needed to swap. You can check it with swapon commands.

    Other reason is that more frequently accesed files may be cached to ram and less important stuff gets swapped. But if you notice swap being used while total ram usage including cached is much lower than total, then its probably zram(and it does (Edit:)not write to disk so dont worry about that)

  • source
  • parent