5 ms·
Although the article claims "Disabling swap doesn't prevent pathological behaviour at near-OOM," I've definitely found this to be the case. My desktop Linux mac
by assbuttbuttass 4y ago
Although the article claims "Disabling swap doesn't prevent pathological behaviour at near-OOM," I've definitely found this to be the case. My desktop Linux machine has no swap, and when I've run into memory pressure the OOM killer just swiftly terminated the program that was using all my RAM (I later bought more).
When I've used machines with swap, my experience has been the OOM killer was much less aggressive. As a result you're left with an unresponsive system blocked on disk I/O.
- webstrand 4y agoThat's interesting, I've have just the opposite experience. I used to run with no swap; when compiling with many parallel processes, my system would sometimes live-lock. The OOM killer never triggered, and as far as I could tell, the issue actually was I/O saturation caused by thrashing on the few pages that the kernel _could_ evict. After enabling swap, I've never encountered this issue again. The machine remains interactive, if slow, under high load. Anecdotally, SIGSTOP-ing some processes when memory pressure is high, even without swap, seems to have some benefit. I'd resume those batch processes later.
- jcelerier 4y agoAnd I had the exact opposite experience as you just last week on multiple machines with swap enabled: compiling and going over the available memory made them entirely inoperable and required hard resets. Had to use another computer to be able to browse internet at the same time, until earlyoom can be installed there.
- cwalv 4y agoI think the key is near OOM. In some cases (e.g. runtimes with configurable heap sizes that trigger garbage collection when the max size is reached) it's easy to setup a system that operates near OOM
- Beltalowda 4y agoI have no swap on my laptop, and due to an accidental bug in a program I was developing my machine ran out of memory a few months ago (twice... my first attempt didn't fix it, oops!) In both cases the system locked up for well over a minute before the process got killed by OOM. It was the "classic Linux experience" regarding OOM. Back in the day I used a lot of FreeBSD on fairly cheap/constraint machines (even for the time) and somewhat frequently-ish ran out of memory, and it was a much "better" experience. I mean, OOM killing stuff is never a "good" experience, but it didn't lock for over a minute.
- rincebrain 4y agoI read that assertion as "there still exist cases where this can happen", not "this has no effect on those outcomes ever".