0

I am surprised to see my Ubuntu 20.04 using swap as there is 700G in buffers/cache.

It has never done this before.

Is something wrong?

I feel like it should return RAM used in buffers/cache to be free prior to using swap.

# cat /proc/sys/vm/swappiness
0
# cat /proc/sys/vm/vfs_cache_pressure
100
# free -g
              total        used        free      shared  buff/cache   available
Mem:           1007         239          18         298         749         462
Swap:           566         138         428
qq72
  • 1

1 Answers1

0

No, paging out is not wrong. Linux will use swap space given to it.

swappiness of 0 and swapping indicates "the amount of free and file-backed pages is less than the high water mark in a zone". This may have happened some time previously under more memory pressure than you observe now.

Linux is not in a hurry to free up used swap space, even after paging some of it back into physical RAM. Those are pages that could be reclaimed if needed in the future.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32