this post was submitted on 12 Sep 2026
661 points (95.1% liked)

linuxmemes

32782 readers
906 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry of any kind will not be tolerated. This is an LGBTQ+-friendly community -- if that is a problem for you, you should leave.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves / tolerates / hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. πŸ‡¬πŸ‡§ Language/язык/Sprache
  • This is primarily an English-speaking community. πŸ‡¬πŸ‡§πŸ‡¦πŸ‡ΊπŸ‡ΊπŸ‡Έ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • Β 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 3 years ago
    MODERATORS
     

    Credit to @ryanc@infosec.exchange

    I just did the graphic

    top 50 comments
    sorted by: hot top controversial new old
    [–] Buddahriffic@lemmy.world 6 points 21 hours ago

    The trick is to first create a RAM disk. Then put the swap file on there and it's about as fast as RAM. Then, with the new memory you have created, make another RAM disk. Yep, then make more swap space on there.

    I have solved both the memory and SSD availability issues with this infinite RAM and disk space trick.

    [–] h4lf8yte@lemmy.ml 7 points 1 day ago

    ACPI S4 Hibernation would like to have a word with you

    [–] bdonvr@thelemmy.club 8 points 1 day ago (1 children)

    I basically never used swap until I used some script that was supposed to de-duplicate text messages from SMS backups.

    Turns out feeding it a 100,000 message archive spanning back 15 years will somehow eat up ~80GB of RAM. I doubt it should, I guess it probably just wasn't optimized for such a large amount.

    So I made a 64GB swap file and it completed fine.

    [–] MissingGhost@lemmy.ml 4 points 1 day ago (1 children)

    Not everything should work from ram. This is why we stream files for processing.

    [–] bdonvr@thelemmy.club 3 points 1 day ago

    The backup itself was only ~8gb.

    [–] Taleya@aussie.zone 3 points 1 day ago

    ZFS chuckles darkly in the corner

    [–] motruck@lemmy.zip 3 points 1 day ago (1 children)

    Swap is there an emergency relief for when a runaway process starts to eat all the resources. The system gets slow the user says hey what's that? They look and see oh wow this one process is really eating a lot of resources that's bad, can I kill it or do I need to gracefully try to shut it down. Swap buys you time when it could matter. When you don't have swap OOM killer takes out whatever it wants and for a desktop user that may not be that big of a deal but for a server the database is likely the first target that is taken out.

    you misunderstand the meme (of course it doesn't help either); because the alternative isn't "no swap", but rather "use a swap file instead of swap partition"

    [–] 0x0@lemmy.zip 2 points 1 day ago

    My 64GiB are enough for my tasks, i don't use swap.
    I may consider it for laptops but only for hibernation purposes.

    [–] Mwa@thelemmy.club 10 points 1 day ago (2 children)

    SWAP RAM is useful for hibernation mode and fall back ram incase you have low memory.

    [–] SirLeToet@lemmy.world 4 points 1 day ago

    Also for when you, for whatever reason, run out of physical memory.

    Who here worries torturing their SSDs? Those things will last lifetimes compared to HDD's of the past (or present).

    [–] WhyJiffie@sh.itjust.works 1 points 1 day ago

    also in case you have too many electron shits open

    [–] smeg@feddit.uk 65 points 2 days ago (3 children)

    > linuxmemes

    > macos screenshot

    ΰ² _ΰ² 

    [–] cannedtuna@lemmy.world 29 points 2 days ago (6 children)

    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.

    [–] CommanderCloon@lemmy.ml 14 points 2 days ago

    That makes it funnier ngl

    load more comments (5 replies)
    load more comments (2 replies)
    [–] tired_n_bored@lemmy.world 7 points 1 day ago (4 children)

    Can anyone tell me why I see swap usage with 10+GB of free RAM available?

    If you(or your distro) use zram then the zram usage may also count as swap in resource monitors. For me this was the case when i saw swap usage where it is clearly not needed to swap. You can check it with swapon commands.

    Other reason is that more frequently accesed files may be cached to ram and less important stuff gets swapped. But if you notice swap being used while total ram usage including cached is much lower than total, then its probably zram(and it does write to disk so dont worry about that)

    [–] Brkdncr@lemmy.world 11 points 1 day ago (1 children)

    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 1 points 1 day ago (3 children)

    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

    load more comments (3 replies)

    Swappiness set to over 9000!

    [–] droans@lemmy.world 5 points 1 day ago

    Because you just taught your computer how to be lazy. "oH lOoK aT mE i'M sWaP mEmOrY"

    [–] irotsoma@piefed.blahaj.zone 64 points 2 days ago (4 children)

    There are good use cases for swap. I work with very performance sensitive memory hogging applications that tend to process in bursts as incoming batched data arrives. We also have a lot of required background "security" applications.

    Having the idle applications move out to swap so that a significant amount of free RAM to allow for the active, real-time applications to expand into is a major boon. RAM is expensive now, so it's become even more critical to not waste it.

    But even in self-hosting at home I take advantage of it since I have a limited number of servers with limited RAM and a bunch of applications and/or docker containers running, many of which don't need to be active at all times, but if they were all active, would have trouble with the limited RAM. Swap allows for inactive applications to free up RAM for the active ones and leave enough available at all times to allow an application to quickly spin up new jobs.

    Anyway, sure, for a simple desktop computer without a bunch of junk background applications running for "security" or whatever, and an overabundance of RAM installed, it's probably not useful. But for high performance, memory hungry applications with lots of background stuff running, it can be a big help.

    That said, there are use cases where the opposite is useful and using a RAM drive is better than writing to disk for cache and temporary logs when you have enough RAM. My opnsense router for instance uses a RAM drive to store cache and logs (logs are mirrored to the NAS for long term storage, so just the local copy is lost on reboot). That system has enough RAM and I'd rather reduce disk wear, and I don't plan to add too many other applications to that server that it would run low.

    Actually, there are more than these. For example, hibernation and/or hybrid suspension. It's, AFAIK, mandatory to have a swap partition to be able to hibernate and/or hybrid suspend your device.

    load more comments (2 replies)
    [–] diaphragmwp@discuss.tchncs.de 12 points 2 days ago* (last edited 2 days ago)

    Once tortured myself with having to go through...

    The Android build system. Booo, scary.

    I only wanted a LineageOS boot image built. The recommended specs list 64GiB RAM. Figured wouldn't apply to me until I tried to build a target literally called "nothing". It just used up all of the RAM and OOMed about 2 minutes in, building the "build cache" or whatever the fuck it needs to do to "warm up".

    After a few fucktons of swapspace, turning off some of my daemons, some sysctl fuckery (there were options for limiting process virtual memory size IIRC? I put it all the way up) and taskset -p 0-15:1 (use logical CPUs 0, 2, 4...), I had my laptop allocating 50 something GiB. I have 16GB (decimal) physical RAM installed and I consider that already way too much for my usual needs.

    After about half an hour of the build system build systeming, it just stopped doing that then built the kernel in 4 minutes with everything else in some time too.

    Yes, I have tried just running make directly. That just resulted in an image that did nothing but toggle on and off an empty (no percentage) charging circle via power button.

    [–] Zenorbi@lemmy.world 45 points 2 days ago (3 children)

    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 11 points 2 days 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.

    load more comments (2 replies)
    [–] OwOarchist@pawb.social 31 points 2 days ago* (last edited 2 days ago) (7 children)

    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.)

    load more comments (7 replies)
    [–] 18107@aussie.zone 42 points 2 days ago (5 children)

    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.

    I am equally disgusted and intrigued

    load more comments (4 replies)

    "I'm not a friggin bear, I don't hibernate!"

    [–] topperharlie@lemmy.world 13 points 2 days ago (2 children)

    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...

    [–] boonhet@lemmy.zip 7 points 2 days ago (1 children)

    Were you using a HDD for swap? It's nearly unnoticeable on an NVMe drive.

    load more comments (1 replies)
    load more comments (1 replies)
    [–] danielfm123@lemmy.zip 11 points 2 days ago

    Swap and zram saved my R and Python Dana analysis script a couple of times.

    [–] dan@upvote.au 27 points 2 days ago (21 children)

    People still use swap partitions instead of swap files?

    load more comments (21 replies)
    [–] RustyNova@lemmy.world 6 points 2 days ago

    I don't really need swap until I need to compile blender... Need somewhere around 64Gb (with compression) to deal with the peaks

    [–] glibg10b@lemmy.zip 12 points 2 days ago (3 children)

    swapfile gang

    .rw------- root root 4.0 GB Mon Jun  1 04:10:37 2026 ο€– /var/swap
    
    load more comments (3 replies)

    unfortunately with S0ix being forced on all modern laptops, zram is the only logical choice. With s3 sleep at least i can say i need swap because i need hibernation...With S0ix? Dont bother.

    [–] Axolotl_cpp@feddit.it 7 points 2 days ago (7 children)

    My built-in Devil's Advocate has to ask if that's really true? Have you got a citation newer than 2 decades old? Frankly, i find it difficult to believe that anyone wouldn't like to use electron software, for the simple reason that making your SSD suffer is fun.

    Edit: in 30 years of administering Linux and (previously) Solaris sytems i've never once had to change HDDs or SSDs, so claims of torture are, i opine, exaggerated. i'll also claim that keeping electron software out of the filesystem is not good for your hygiene.

    load more comments (7 replies)
    load more comments
    view more: next β€Ί