Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
2  
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
1  
@Zifre: Might want to put that in an answer –  TheLQ Jul 19 '10 at 1:26
2  
@Zifre: Saying its not possible counts as help –  TheLQ Jul 19 '10 at 18:25
1  
@whoever closed this: I don't think this is a duplicate. The situation with that question (superuser.com/questions/30309/unnecessary-swapping-in-linux) 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
1  
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.