3 ms·
The most compelling reason to enable at least some swap space is that the Linux kernel's memory handling algorithms can't cope with there being no swap. If you
by efaref 9y ago
The most compelling reason to enable at least some swap space is that the Linux kernel's memory handling algorithms can't cope with there being no swap. If you have no swap, then you will encounter stalls and OOMs even if you don't actually run out of memory. Adding even a tiny amount of swap prevents this from happening.
- albertzeyer 9y agoThis sounds as if it is a serious issue and should be fixed. Is there a bug report about it?
- lolc 9y agoThis is due to memory overcommit, it's a performance feature. You can turn it off.
- kevin_nisbet 9y agoInteresting, I sort of remember an interaction with NUMA as well. I don't believe this is a bug, just a miss-understanding of the way the underlying system works. From what I remember when swapiness is 0, there are lots of reports of processes that use more than a single NUMA node worth of memory getting killed by the OOM killer, even with plenty of free RAM available. I unfortunately don't remember the details, but this prevented the memory from being able to be allocated to the additional node. I've heard of this mostly with mysql, where it's common to have a big server with lots of RAM, but a single large process that uses most of the system RAM. The way we got around this, was by setting the process to allocate interleaved among the NUMA nodes. I'll have to dig into the overcommit.
- warrenm 9y agoIt's not a serious issue at all. It's intentional.
- bechampion 9y agoi agree with this , lack of swap makes oom too aggressive . , question what's worst no app (and react to OOM) or app swapping
- notyourday 9y agoOOM is tunable.