4 ms·
On real machines I run with a super low swappiness of 1-5 or so, which effectively means it will always use RAM, basically until its too late. That way its diff
by lionkor 2y ago
On real machines I run with a super low swappiness of 1-5 or so, which effectively means it will always use RAM, basically until its too late. That way its difficult to accidentally get OOM killed, instead everything just slows way down when swap gets involved when RAM is full.
- IshKebab 2y agoYeah the trouble is in my experience it slows down to the point that the system is unresponsive and you have to reboot anyway. I don't think Linux has a good answer to RAM management other than "buy lots and lots of RAM" (I already have 32GB and it's nowhere near enough). I wish it worked like Windows - I've never had to reboot due to lack of RAM there, and even when the system is unresponsive ctrl-alt-del is very reliable.
- dspillett 2y agoI've had Windows hang due (apparently) to OOM before now, most recently last week: already low on free memory due to other things, a runaway chrome tab chef through a huge pile of memory overnight. Come morning everything was at a crawl (task manager responded quickly but everything else took an age to register any event like a click or keypress. Bringing up chrome's task manager, sorting by RAM use, and navigating to the top of the list, to find the problem, took several minutes. Switching to that tab hung everything, even task manager. This was running in a VM so I could see from the host that the OS has hung: practically no CPU or IO use, what little there was was likely just "background noise" from hyper-v, also not even the simplest service accepted TCP connections nor would it respond to ping. Left it like that for tens of minutes to see no change, so resorted to a hard stop & start. It happens, albeit quite rarely.
- MrDrMcCoy 2y agoEarlyOOM, swap, and zswap is the answer combo you're looking for. With those in place and properly tuned, you'd have to have something go extraordinarily sideways for an actual issue to appear.
- IshKebab 2y agoI have swap and zswap. It just delays the problem. And anyway, I don't recall having to tune Windows to work properly.
- Spivak 2y ago> instead everything just slows way down when swap gets involved when RAM is full I have literally never wanted this and so I'm curious why you do. This is why earlyoom is a thing precisely because grinding your system to a halt is often worse than killing and restarting some processes. High swappiness so you run slower but never lock up or low swappiness with an aggressive oom killer so you don't lock up are to me the only sane options. Why do you want your servers to be up but thrashing?
- lionkor 2y agoFor me, if I run out of RAM, its because im running a task that should not fail - so the reasoning is that id rather have it take longer than fail.
- pantalaimon 2y agoBugs happen and memory leaks happen. Also make -j is prone to run out of memory if you have many cores, I’d rather adjust the number of threads than have my system grind to a halt.