Linux sucks at dealing with OOM situations 馃槖

Web 24 3 22

Guess I'll have to upgrade to 96GB of RAM to keep browsing the web, eh? 馃檮

Show thread


Compared to anything else that doesn't freeze for minutes when you reach 80% memory usage.

@fribbledom @carcinopithecus I don't think there is such a thing, on desktop at least. I haven't seen one. I don't think windows even has an OOM killer. Don't know about macs but I had plenty of oom situations on windows which could only be practically resolved with a hard reset, linux at least kills the process off or you can trigger it manually with sysrq

@fribbledom @carcinopithecus
Supposedly it should kill off offending applications but I have never seen that happen anywhere, for anyone. Hard reset or a couple of hours of patience is the only way.

I've always had Alt+Sysrq+F work, but never seen it triggered manualy, not even with earlyoom.
@vaartis @fribbledom @carcinopithecus


Right, I tried that combo as well, but I guess at that point it's already too late: the system seems to actually try to kill "offending" processes, but it freezes in doing so.

@sudoreboot @vaartis @carcinopithecus

@fribbledom @nighthacker2003 @sudoreboot @carcinopithecus the reality is probably that the X server is hanging too and you need to switch to raw mode with sysrq+r, and THEN do sysrq+f. That worked out quite a few times for me, the X usually becomes very unresponsive under pressure.
@fribbledom @nighthacker2003 @sudoreboot @carcinopithecus actually apparently it switche from the raw mode, not very intuitively named: "Switch the keyboard from raw mode, used by programs such as X11 and SVGALib, to XLATE mode ". Nevertheless, the key is r.
@fribbledom oops ram is full better slow to a crawl instead of oom killing something

@piggo @fribbledom Fedora ships with earlyOOM, is that not good enough?

My experience with Windows running out of ram is heavy swap file usage. I hate it

@fribbledom I disabled overcommitting here, which now makes glib sucks with OOM situations, luckily the glib-based programs I have can crash.


Agreed yeah. Let me be more specific then:

Linux sucks at dealing with 20% memory avail before OOM situations.

@fribbledom You must be doing something weird. Are you hitting swap?


Possibly, on all of my systems however. Swap or not doesn't matter. When I reach - pretty exactly - 80% RAM usage, my systems freeze for minutes, sometimes hours.

@fribbledom I have never had that problem. These days, I very rarely use that much of the RAM, though.

@fribbledom @mansr Well there's your problem!
The kernel expected you to have replaced all your 7200rpm swap drives with PCIe NVMe M.2 flash RAID arrays.
I mean it's 2020, comon now ;}

@fribbledom @mansr I.. uh.. oh. I didn't expect that 馃槦

It was supposed to be a joke on spending more for swap space solutions than on real RAM :{

@dissy614 @mansr

Maybe change your swapiness to something like 5 instead of the default of 20. Then it won't use swap till you hit 95% mem usage.


Nah, that's not it. Happens both with and without swap space.

@dissy614 @mansr

@fribbledom @mansr That's weird, I've also not seen that. The only similar thing I've had is with slow storage devices if you're writing a lot to them; you can fill all of your memory up with to-be-written data that you have to wait to be written; that actually gets worse with more RAM. If you have a shitty USB stick like that or similar, you can reduce the write limits.

@penguin42 @fribbledom @mansr we have seen this problem at work.... on massive aws ec2 clusters running genome sequencing. linux dont like low mem situations

@bamfic @fribbledom @mansr Sorry, I was trying to ask whether it (a) OOMs or (b) hangs - which one?

@bamfic @fribbledom @mansr On your EC2 cluster, have you got EBS block configured as swap? My understanding is they're quite slow and/or rate limited so they can stink for swap.

I've had that happen, but I think that Chrome was the culprit. I think it does t play nice with OOM. Since I switched browsers I haven't really had that issue.

i highly highly recommend the Linux Memory Management At Scale talk from ArchConf2020. Chris nails out of the park how they keep systems responsive. oom is one of the big three topics here & seems like one that has a ton of near future wins happening.


this is because the silicon valley is full of young creative geniuses, dude.

@fribbledom ah, I see you're not planning on watching videos in the browser

@fribbledom I suppose the minimal requirements will tide you over for a few months, but 256 GB and three GPUs are recommended for web browsing.
I've already moved my Chrome instance to an AWS compute center just to be safe

@fribbledom I'm using FreeBSD with 4G RAM and 10G swap. I did have to fiddle with firefox's configuration a little to keep its memory use down, but it works fine now that I have.

@fribbledom talking about filling up RAM with the browser: back in the day first wordpress website I built constantly crashed browsers of the visitors. It worked fine for me though. Turned out I placed some high-quality, raw photos in a gallery on one page which required around 16gb of RAM. No problem for my development maschine though so I didn't notice 馃槄 Classic.

@carcinopithecus @fribbledom Even now, I don't run out of memory from having 16GB plus 16GB of swap partition. And the swap only becomes heavily used if I do something like render a really complex scene in Blender.

These days, I'd consider 16GB to be a baseline desktop machine, and I'm really mad at Apple for even selling 8GB options at all for their newly launched M1 machines, considering that upgrading is literally impossible because the RAM is embedded in the SoC.

Of course, there's no telling how well it will work out, considering that they got away with selling embedded mobile devices with 1/4 of that or less, but still, these are desktop machines.

I find that Chrome and Chromium stuff tends to eat a good portion of memory, and that every Electron app has its own instance of Chromium or CEF or equivalent, and so does Steam and so does EGS if I use that.

But yeah, at this point, I consider 16GB fairly decent for regular use, and that you should have a swap capacity equivalent to that Just In Case.


Typically between 50 and 100 tabs, probably open for a few days up to two weeks.

@fribbledom @carcinopithecus

well, when I was young my Vic20 was able to do it. It鈥檚 perfectly logic to complain about ram usage, while using 50-100 instances of a segregated virtual machine , plus 50-100 instances of a javascript interpreter. Why should you run out of memory? Must be the operating system which sucks鈥.


Sigh. Better read the entire thread. It doesn't even really OOM, it freezes at pretty much exactly 80% of memory usage, for minutes to hours.

Yes, sorry, I need that many tabs. That's why I got 64GB of RAM in my machine.


@fribbledom @carcinopithecus

sorry, no. I don鈥檛 drink that. You perfectly know that the last trend about browser is segregation of tabls, which implies no shared memory. so each tab , plus a javascript interpreter, requires more or less 1GB. Plus, the OS must cache the filesystem and keep the VMM.

To open 50-100 of those segregated tabs, ~128Gb should be considered.

Now we can discuss how much this browser sucks, or this html engine sucks, but still, is the browser which sucks. Not the OS. The OS is just running on undersized hardware.

In the image below, you can see how much a single tab is taking to write this answer to you, on both browsers.

So your machine is undersized, and linux has a little to do with the fact browsers are horribly inefficient. Yes, with no swap linux will try its best. But, still you want to keep all of the tabs running, none swapped, and you have more sw than RAM.

What you expect?

Sign in to participate in the conversation

Server run by the main developers of the project 馃悩 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!