• topperharlie@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    24 minutes ago

    Everyone defending swap like crazy in the comments… so let me give a counter argument specifically for desktop:

    Many years ago I stopped using swap on all my computers (I exclusively use linux) and the reason is: every time anything regarding interactivity went to swap, my system would freeze and literally become unusable for a really long time until I killed something. Since I got tired if that behaviour I decided I prefer for random shit to die but my computer still be usable.

    It wasn’t very often, but I don’t get OOM killer often either (as in I don’t remember the last time it happened and I use linux every day for both work and fun), and the freezing situation was way more annoying, to the point I sometimes ended up cold switching off the computer. I’m surprised on how many people run out of memory constantly. I guess you all are just using linux for servers and have crazy processing of infinite data…

  • OwOarchist@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 hours ago

    Yes, swap partitions are shit.

    The real hotness is swap drives.

    Just the use that your old 64GB SSDs were waiting for!

    (Fun fact: in Linux, if you have multiple swap partitions mounted, the kernel will automatically use striping (like RAID) in order to read and write from them as fast as possible. If you have multiple small SSDs used for swap, the read/write speed from swap can actually become pretty fast.)

  • 7rokhym@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    8 hours ago

    Definitely configure swap, but I don’t think there is much benefit of a swap partition over a swap file these days and swap files are trivial to configure.

    • zitrone 🍋@europe.pub
      link
      fedilink
      arrow-up
      0
      ·
      8 hours ago

      right real linux user do everything in the tty and maybe put something in the framebuffer if they want to view an image or similar

    • cannedtuna@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      9 hours ago

      Used a website to make the windows since I was on mobile. Thought it looked too plain w/o the window decorations, but yeah. I mean there’s so many distros and themes, who’s to say it couldn’t be Linux. I’ve seen KDE reskinned to look like OSX

      • alecsargent@lemmy.zip
        link
        fedilink
        arrow-up
        0
        ·
        8 hours ago

        It’s fine, I really like MacOS X too. To be fair those window decorations looks real nice as demos.

  • azimir@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    9 hours ago

    I have a small home server that I occasionally push through huge batch processing jobs. During the pushes, I might collide with other projects that use a pretty big chunk of the RAM. So, to make sure it’s never a killer (just a major slow down), I made a 32GB swap file. If I need it, it’s there and disk is hella cheap.

    This machine has never had a GUI installed. No browsers to complain about, just plain old data processing, stats models, and old skool computing.

    Now, my worst case scenario was building a C++ program on a raspberry pi gen 1. That has 256MB of RAM. g++ ran out building, so I NFS mounted a huge disk from my desktop machine and made the swap file there. The build took a while… but the program ran fine after the week long build, no swap needed.

  • provectus@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    9 hours ago

    Then what is the setup if my computer only has 4GB of memory for daily driving? Just curious because swap partitions are what I normally do on limited resource machines.

    • mlg@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      9 hours ago

      Dunno how well zswap handles at that size, but the point is that is compresses swap into RAM, so it would use a max of 819.2M for a total of 2457.6M of swap space. If you need more, then by all means, use a swap file or partition lol.

      Actually linux easily supports multiple and tiered swap mounts, so you could even go zswap + ssd swap + hdd swap, or a cheapo “burn at your own risk” usb flash swap lol.

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

    • cannedtuna@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      9 hours ago

      Shit did I botch it? I made this on my phone and the toot I copied the script from was just text. Wanted to make it look more interesting so I found this site that let you make the windows. I just went with what I thought looked best.

      • smeg@feddit.uk
        link
        fedilink
        English
        arrow-up
        0
        ·
        9 hours ago

        I hope the phone is running PostmarketOS ;)

        TBH I’m sure you could configure a linux terminal to look like that, but yeah it looks very default macos to me

  • rem26_art@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    10 hours ago

    Building a PC in 2026 be like “I cant afford RAM, but I can use a whole TB hard disk I shucked from an old WD external as swap and maybe my PC will feel modern”

  • 18107@aussie.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 hours ago

    No

    15.5/15.5 GB RAM used, plus 16.8/465GB swap

    It turns out the computer mostly freezes once you go past 200% RAM used.

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      9 hours ago

      I actually did this for a laugh a very, very long time ago. I had upgraded my 75MHz Pentium machine from 8MB to a whopping 40MB, so since I knew it would run fine with just 8, I installed a TSR RAMdisk and told Windows 3.1 to put its swap on that drive.

      It worked great, but I decided I’d rather use the memory for other things.

      But in more modern times, I’ve literally forced browser caches into memory-based tmpfs to take the load off system disks, which is basically the same thing. And it reduces wear on my hardware.

  • Blue_Morpho@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    11 hours ago

    “Unresizeable block device at end of disk”

    Classically the swap partition was located at the physical middle of the drive so that on average, no matter where the heads where, the swap partition wasn’t far away

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 hours ago

    “Hello I would like to torture my SSD’s FTL because I left three Electron apps open”

    If you don’t actually need the swap, Linux isn’t going to make use of swap. If you need the swap, then you’d probably rather use it than have the OOM killer take out a process.

    My desktop has plenty of swap available, but is using none of it, because the system isn’t under memory pressure.

    • OwOarchist@pawb.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      7 hours ago

      If you don’t actually need the swap, Linux isn’t going to make use of swap.

      Eh, yes and no.

      It will offload things from RAM into swap in order free up RAM space for disk cache. Which is kind of a weird reversal when you think about it, loading your RAM contents onto disk so that you can load your disk contents onto RAM. But by doing this to idle processes in order to disk cache files you’re likely to use soon, the system does become significantly faster and more responsive.