• Zenorbi@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    15 hours 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
      0
      ·
      9 hours 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.