Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm finding linux's swapping strategy to be somewhat less than ideal. In general I have a ton of processes running, maybe 40 or more big ones, and only end up using a few regularly. Nonetheless, I find that I often have to wait for pages to unswap when switching between these processes. Is there some reason why it wouldn't offload pages that aren't frequently used to swap space in order to make room for those that are?

I do have swappiness (/proc/sys/vm/swappiness) set pretty low (at 10). However it still seems like it's still not prioritizing frequently used pages properly; other pages should be getting swapped out instead of the ones that are frequently used. What can I do to learn more about this and/or fix it?

share|improve this question
Unfortunately, I don't think there is much that you can do. The main problem is that it is not possible for the OS to know exactly how often pages are used. It has to periodically check flags on the page tables, which doesn't give very detailed information... The solution: get more RAM :( – Zifre Jul 19 '10 at 1:06
@Zifre: Might want to put that in an answer – TheLQ Jul 19 '10 at 1:26
@Zifre: Saying its not possible counts as help – TheLQ Jul 19 '10 at 18:25
@whoever closed this: I don't think this is a duplicate. The situation with that question ( is that there is swapping going on when memory is only ¼ full. In my case, memory is pretty much full. Swapping is necessary here, but I have issue with the way it's doing it. – intuited Jul 20 '10 at 6:05
@Zifre - even though my knowledge of the topic is limited, it doesn't seem like an exact duplicate to me. It may be on the same topic, but situation and actual question are different, so I reopened it. Also, it's ok to post a "there is no solution" answer, with an alternative, like you did in your first comment. You should post it as an answer indeed, in my opinion. – Gnoupi Jul 21 '10 at 5:56

You must log in to answer this question.

Browse other questions tagged .