4 ms·
Having some swap with low swappiness allows the system to page out pages that are unlikely to be used or haven't been used in a long time but aren't backed by a
by michaelmrose 7y ago
Having some swap with low swappiness allows the system to page out pages that are unlikely to be used or haven't been used in a long time but aren't backed by a file.
In normal conditions this frees up memory for more useful data and helps you avoid getting to perverse conditions.
- IshKebab 7y agoThat's how it should work yes. Unfortunately it doesn't actually happen like that, hence this entire discussion.
- michaelmrose 7y agoIt actually DOES happen like this. When the entire working set for actively used apps fits in memory swap lets the system page out things that are little used. This works perfectly fine. This is to say that swapping out little used stuff delays the point where you are actually out of memory and performance goes straight to hell. This means the optimal arrangement for desktop use is some swap and low swappiness. One could imagine that perhaps something like https://github.com/rfjakob/earlyoom https://github.com/rfjakob/earlyoom Might be an easier route to better behavior especially as you can more easily tell it what it ought to kill. The behavior of the kernel could probably be improved but it is probably inherently lacking the data required to make a truly optimal choice along with a gui to communicate with users. Going forward possibly desktop oriented distros should probably come with some out of the box gui to handle this situation built into their graphical environments before it gets to the point of dysfunction.