• sumsinj@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    15 hours ago

    I dislike swap solely because it gets used and when I accidentally open the same file twice then I regularly encounter problems with swap files when opening the file again later.

    • Brkdncr@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      19 hours ago

      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.

      • WhyJiffie@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        0
        ·
        9 hours ago

        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

  • Zenorbi@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    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.