• Zenorbi@lemmy.world
    link
    fedilink
    arrow-up
    45
    ·
    2 days ago

    I used to be this guy. We have huge amount of memory in our storage server. Why would we need swap? Well, once the system started killing programs I read up on swap and how the system handles its caches, especially ZFS ARC.

    Short version is that while the system can evict its caches syncronously, it can only async notify ZFS that it should also shrink its caches, but the out-of-memory killer will start killing before ZFS and its kernel counterpart can start to free up memory.

    A tiny bit of swap completely solved this, since swapping is sync for the kernel and the OOM killer will wait for it.

    • Fizz@lemmy.nz
      link
      fedilink
      arrow-up
      11
      ·
      2 days ago

      As well as oom situations, swapping allows the memory to be used more effectively by swapping out anonymous pages that aren’t likely to be used but can’t be dropped.

    • grrgyle@slrpnk.net
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      I found that with swap the applications would slow to a crawl and then basically lock up entirely until I hauled my ass over and manually power cycled the machine.

    • j3tt@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      I sometimes cannot do hibernate when I did a scrub on my ZFS. But the first try always frees up the swap and so the second attempts works every time.