I've set up a virtual machine through KVM-libvirt (virt-manager) with Windows 10 on it and I'm getting an odd behavior on the host side. I'm running a 64bit Arch host with 24GB of RAM, 12 of which are allocated to it and the other 12 to the VM.
After starting up the VM and letting it sit for a while, not too long maybe an hour so, my entire host's remaining RAM gets buffered/cached. For instance, right now I get this from free -m
:
total used free shared buff/cache available
Mem: 24064 13887 253 110 9923 9957
Swap: 4095 1313 2782
Before starting the VM I had a couple of applications running, but they didn't amount to more than 2GB or so of RAM, and nothing new has been opened since then, just some normal web browsing (writing this question actually).
Now, I've read around a lot about linux caching RAM because free RAM is wasted RAM and whatnot, but this is causing almost everything that's running on the host to get swapped. And that is a big problem for me because everything gets so slow.
As far as I can tell, RAM caching should not cause memory to be swapped. I know linux is supposed to be smarter than me about efficient memory utilization, such as how I shouldn't clear the swap and/or cache... but, having everything swapped out thus slowing down the system considerably doesn't sound smart nor efficient to me.
What could possibly be going on? Is linux caching the VM disk accesses and that's why it's always using the entire remainder of my RAM? The VM is installed in a disk image, should I try using a separate physical disk for it?
swappiness
: unix.stackexchange.com/search?q=swappiness