It sounds quite counter-productive to me to cache pages that are swapped out. If you swap pages in, what is the advantage to first cache them in memory, only to have to than move them to the right place? Even if pages are swapped in proactively, doesn't it make more sense to "just" swap them in? Doesn't in fact caching swap is just a waste of resources?

  • You, ma'am/sir, get extra goody points from me for your questions. Wish I could up-vote twice.
    – Eli Frey
    Commented Aug 14, 2010 at 6:19

3 Answers 3


After some more research, I have found that the term SwapCached in /proc/meminfo is misleading. In fact, it relates to the number of bytes that are simultaneous in memory and swap, such that if these pages are not dirty, they do not need to be swapped out.

  • 2
    That's pretty much equivalent to being cached, though, isn't it? I mean, WRT the kernel's memory management system, "cached" means "both on disk and in RAM", right?
    – SamB
    Commented Sep 4, 2012 at 16:47

Never even heard of this one and it doesn't make a lot of sense to me either. I still think the good old rule of making sure it just doesn't swap at all (except of course the reservations) is best. Now, theoretically, the caching of stuff in direct available memory which takes a while to load from something as slow as a disk, has an apparent advantage. But if you're able to cache to-be-swapped pages, why again swap in the first place?


The point of having pages duplicated between swap and RAM is to avoid waiting for the disk if either:

  1. Something needs to read from them

  2. They need to be evicted to make room for something else

If they were only in swap, case 1. would mean waiting for them to come in from disk; if they were only in RAM, case 2. would mean waiting for them to go out to disk.

(Of course, case 2 is actually a little more complicated, since it's obviously cheaper to evict such pages, so the kernel probably evicts them preferentially, but the point should be clear.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .