0

I am trying to figure out what the difference is between paging and swapping on linux. My question mainly relates to the output vmstat gives you. Example:

  $ vmstat -s
  8022500 K total memory
  2761696 K used memory
  3647052 K active memory
  2316288 K inactive memory
  1579228 K free memory
   295964 K buffer memory
  3385612 K swap cache
  4194300 K total swap
        0 K used swap
  4194300 K free swap
    15273 non-nice user cpu ticks
        0 nice user cpu ticks
     6141 system cpu ticks
   198640 idle cpu ticks
     1621 IO-wait cpu ticks
        0 IRQ cpu ticks
      282 softirq cpu ticks
        0 stolen cpu ticks
  2190475 pages paged in
   882132 pages paged out
        0 pages swapped in
        0 pages swapped out
  1542526 interrupts
  3926900 CPU context switches

I thought that in linux swap really means paging (anonymous paging). So why are there still different metrics? And assuming there is a difference, if a page is paged out (not swapped), where does go? Is it still written to the swap file?

I know heavy swap is an indicator of memory pressure, can the same be said about paging out? Can heavy page out ever be an indicator of memory issues? If so, what should I look for?

  • @ArtemS.Tashkinov is that answer correct for linux? It also mentions that swapping is moving an entire process out of memory but from what I can tell this is not true in Linux. Also the answer is light on the details of what happens when something is paged out. I would like to know where paged out pages are written to. – Lasse Jacobs Jul 05 '22 at 20:36
  • 1
    The question provides evidence it was *about* Linux, e.g. `cat /proc/meminfo` - this file is Linux specific AFAIK. – Artem S. Tashkinov Jul 05 '22 at 21:45

0 Answers0