To be clear, I don’t blame the poster of this comment at all for the content of their post – this is accepted as “common knowledge” by a lot of Linux sysadmins and is probably one of the most likely things that you will hear from one if you ask them to talk about swap. It is unfortunately also, however, a misunderstanding of the purpose and use of swap, especially on modern systems.

  • DefederateLemmyMl@feddit.nl
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 years ago

    0 swap: which was pretty awful with constant unexpected system freezes/crashes

    I’ve run Arch without swap for many years without issues. The key of course is that you need enough RAM for what you are trying to do with your computer.

    There’s no reason why a 32GB RAM + 0GB swap system should have more problems than a 16GB RAM + 16GB swap system with the same workload. If anything, the former is going to run much better.

    swap file: finicky but doable

    What is finicky about a swap file?

    It’s just this:

    mkswap -U clear --size 4G --file /swapfile
    swapon /swapfile
    

    Done

    If anything it’s way easier to create a file in your filesystem than having to (re-)partition your drive to have a swap partition. Much more flexible too if you want to change your swap configuration in the future.