On 2016-07-21 21:53:11 +0100, Ben Hutchings wrote: > It's true that if the system has to swap a lot of data out then it is > likely to become unresponsive. However, I think there are good reasons > to enable a small amount of swap space: > > - Some long-running applications have, effectively, memory leaks of a > bounded size that can profitably be swapped out > - The exact same problem can occur with memory-mapped files, and by > disabling swap you prevent the kernel from balancing demand for > anonymous and file-backed memory
Unfortunately, AFAIK, one cannot tell the kernel to use swap only in these cases. I'd prefer to buy "a small amount" of additional RAM that would replace swap in these cases, and avoid a system freeze if something goes wrong. Swap could actually be interesting if the swap/RAM ratio were important, say 10 or more, because in such a case one couldn't avoid swap by buying more RAM (too expensive or not possible). But this means that one should have control of how swap is used. To give an example, I think that /tmp = 4 GB tmpfs + 80 GB swap could be a better solution than /tmp being a part of the root filesystem. Something like that. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)