Score:0

Swap used but there is free RAM

tt flag

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
Score:0
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.