Clearing ram from VM

adamb

Famous Member
Mar 1, 2012
1,323
73
113
I have made a few posts about VM's with large amount of ram and live migration. After giving it some thought I was thinking I could simply clear what's in ram before the live migration but it looks like the host itself won't let go.

I can run the following on the guest which drops the contents of the ram with no issues
echo 3 > /proc/sys/vm/drop_caches

I then look on the host and the ram is not being released, is there a way I could release the ram from the host so that live migration won't attempt to transfer all the contents, I was really hoping I could just drop cache before a live migration and all would be well.

Is there anytype of kvm commands which could do this for me? I appreciate the input!
 
Looks like I might be able to pull this off if I was to put the memory inside of a balloon and just take it back when I want to do a live migration. So I would need to clear the cache on the guest, then pull the balloon of ram, and kick off a migration. Not exactly what I am looking for, but I think it will work.

Open to any suggestions.
 
I am guessing this mapped memory gets mlocked on the host as I can't even clear it with drop caches on the host. I wish there was a way to unlock these pages, no one has any idea on how memory management works? I guess I should start to look at some kvm lists.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!