• OwOarchist@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 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
    ·
    6 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
      ·
      7 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
      ·
      7 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
        ·
        6 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
    ·
    7 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
    ·
    7 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
      ·
      7 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
    ·
    8 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
      ·
      2 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
      ·
      7 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
        ·
        7 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
    ·
    8 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
    ·
    8 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
      ·
      8 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
    ·
    9 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
    ·
    10 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
      ·
      5 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.

    • adarza@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      6 hours ago

      that’s what trixie’s netinst defaults to when i set up new desktops using encrypted lvm… root and swap volumes inside that, unlocking together at boot. my use doesn’t hit swap much, so it’s nbd. i just leave it like it is. only where an installer doesn’t support encrypted swap partitions do i use a file or ram-based swap instead.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        0
        ·
        6 hours ago

        It’s not as bad with LVM since LVM is more flexible. A swap file does still make it easier to change the size as needed though. If you need more swap, you can spin up a new swap file pretty much instantly while the system is running, without having to repartition. You can have both a swap partition and a swap file active at the same time though.

        On systems where the data is encrypted, also encrypting the swap makes sense so I’m glad Debian does that.

      • Ooops@feddit.org
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        7 hours ago

        It’s doable with a swap file instead. But some filesystems are more supportive than others.

        For example BTRFS doesn’t support swapfiles over multiple devices (so my raid1c3 spanning 3 differently sized disks for example) and also swapfiles must be completely pre-allocated. (On the plus side BTRFS automatically blocks any accidently attempt to backup a subvolume containing a swap file.)

        And no matter the filesystem you need to manually tell the kernel device and physical offset for the file via kernel parameters. Which can again be easier on some than on others (also causing the no-multiple-device filesystem problem mentioned above.

      • PervServer@fedinsfw.app
        link
        fedilink
        English
        arrow-up
        0
        ·
        10 hours ago

        Nope, I hibernate with a swap file and it’s in a LUKS partition. Although IIRC that whole setup requires me to use systemd boot.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        0
        ·
        9 hours ago

        I’ve seen so many setups where people encrypt their data but forget to encrypt their swap.

        • DevDave@piefed.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          5 hours ago

          what’s the problem? it’s not like you dump the entire contents of your system’s ram to disk any time use hibernate /s

          • dan@upvote.au
            link
            fedilink
            arrow-up
            0
            ·
            5 hours ago

            Even without hibernation, data in apps you have open will end up in the swap if your system is ever RAM-constrained.