Article 4XJTF Why does buffer cache build up cause unnecessary swapping?

Why does buffer cache build up cause unnecessary swapping?

by
SandaruLJ
from LinuxQuestions.org on (#4XJTF)
(I'm using bold words to refer to 'free -h' columns)

I have Arch Linux installed on my laptop with 4GB RAM. When I'm copying a large file (or doing anything involving file operations), I can see the Mem: buff/cache increasing using 'free -h'. Regardless of how much RAM I'm using at the moment, buff/cache grows up until there's only about 100mb of Mem: free memory. Then, when the value of Mem: free goes below 100mb, the system starts swapping. Usually about 35mb of data gets swapped, and it stays around that number. Then, as the file is still being copied, the data amount in Swap: used fluctuates between 1-2 megabytes. If 35mb are swapped, it becomes 36mb after a few seconds, and then after another few seconds it returns to 35mb. This fluctuation affects the performance as it continues swapping in and out until the file is copied. I've experienced this behaviour on Arch, PopOS and Elementary OS. So I thought this was normal for linux until...

I recently installed Linux Mint and noticed that this doesn't happen on it. No matter how large a file I try to copy, Mem: buff/cache grows until Mem: free goes below 100mb, and then it stabilizes. Mem: free value fluctuates slightly by about 10 megabytes. In Mint, swapping doesn't occur while copying files.

How does this happen? Does Mint have special settings that prevent unnecessary swapping? If it does how do I apply them to Arch or any other distro?

PS: Sorry for my bad English and the terrible structure of the question. I tried my best to put this together.latest?d=yIl2AUoC8zA latest?i=MZRUqYMQPfY:SjdOy0HsYN8:F7zBnMy latest?i=MZRUqYMQPfY:SjdOy0HsYN8:V_sGLiP latest?d=qj6IDK7rITs latest?i=MZRUqYMQPfY:SjdOy0HsYN8:gIN9vFwMZRUqYMQPfY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments