RAM usage is not going down (VM cleared cache)

NoSum

New Member
May 15, 2021
27
0
1
36
I am unsure if this is normal behavior for a Linux ballooning + KSM VM but I created a VM and ran the following command to consume full RAM

Code:
stress-ng --vm-bytes $(awk '/MemFree/{printf "%d\n", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1

The nodes total RAM usage went up by 90GB I then cancelled the program and the VMs RAM usage has been the following for several hours now however the nodes RAM usage is not lowering (VM usage shows 2/96 GB). The only way to restore the RAM is by rebooting the VM.

Code:
[root@ip70 ~]# free -g
              total        used        free      shared  buff/cache   available
Mem:             94           2          91           0           0          90
Swap:             0           0           0
 
Last edited:
This is happening in another Proxmox node too which is a shame and to correct my last message it looks like it only changes on complete stop/start of the VM.

https://i.gyazo.com/2dd8bb8effb41abc6819091676178e81.png - Before starting VM RAM usage

https://i.gyazo.com/ee911d56eba5d6b953075223bb17c17b.png - After it runs RAM test (use all RAM)

The nodes RAM stays like that until a complete power cycle down even with the VM having no cached RAM

Code:
free -g
              total        used        free      shared  buff/cache   available
Mem:             19           0          18           0           0          18
Swap:             0           0           0

Is this normal ballooning behavior? The RAM is not being returned

9f84f303ca94e663a48cb28f21f3ea12.png
 
Last edited:
Ballooning is creating pressure by limiting the guests RAM from max down to "Minimum memory". If your minimum RAM is the same as your maximum it wont shrink the guests RAM and cached data won't be freed. Atleast that is how I understand it.
 
Ballooning is creating pressure by limiting the guests RAM from max down to "Minimum memory". If your minimum RAM is the same as your maximum it wont shrink the guests RAM and cached data won't be freed. Atleast that is how I understand it.
The issue with using minimum memory is some applications show out of memory errors in my experience if I set it lower and also
Code:
free -g
command does not show accurate memory allocations.
 
Then you won't be able to do much against it. Linux will eat all RAM you assign to the VM. You could run something like echo 1 > /proc/sys/vm/drop_caches using cron every 30 minutes to clear the caches but that isn't really helpful either because caching is a good thing in general.
 
Then you won't be able to do much against it. Linux will eat all RAM you assign to the VM. You could run something like echo 1 > /proc/sys/vm/drop_caches using cron every 30 minutes to clear the caches but that isn't really helpful either because caching is a good thing in general.
I already did that inside the VM to test with no results. As you can see from above there is no caching and the VMs RAM usage has gone below 1GB but the nodes total RAM usage is still near full as if it's still using the full 20GB

d975134336e146641e4c51ca92ed931d.png
 

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!