RAM in KVM guest is significantly less than what was assigned

SagnikS

Well-Known Member
Feb 23, 2018
39
2
48
22
I created a VM in Proxmox with 16GB RAM. Memory ballooning was enabled (min=4GB). At the time of this happening, the host had 10~GB RAM available. I was trying to start a process on the VM when it said that it couldn't allocate memory. After running htop, it showed that the VM had 8.36GB RAM only. Any idea what went wrong/could have gone wrong?

VM conf file:

Code:
agent: 1
balloon: 4096
bootdisk: scsi0
cores: 4
cpu: host,flags=+spec-ctrl
cpuunits: 16384
hotplug: disk,network,usb
ide2: none,media=cdrom
memory: 16384
name: 113-179
net0: virtio=9a:af:d5:c3:bc:b9,bridge=vmbr0,firewall=1
numa: 1
ostype: l26
scsi0: ds-hv-kvmcompute-4.de-fsn_nvme_thin-pool0:vm-406-disk-0,cache=writeback,size=112G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=03cf4925-24bc-4b61-9588-2ef6c5e1908c
sockets: 1
vmgenid: 883a72e6-8276-452c-99ea-c9fed592cba7


Output of pveversion -v:

Code:
root@ds-hv-kvmcompute-4 ~ # pveversion -v
proxmox-ve: 5.4-1 (running kernel: 4.15.18-12-pve)
pve-manager: 5.4-5 (running version: 5.4-5/c6fdb264)
pve-kernel-4.15: 5.4-1
pve-kernel-4.15.18-13-pve: 4.15.18-37
pve-kernel-4.15.18-12-pve: 4.15.18-36
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: not correctly installed
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-8
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-51
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-13
libpve-storage-perl: 5.0-41
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-26
pve-cluster: 5.0-36
pve-container: 2.0-37
pve-docs: 5.4-2
pve-edk2-firmware: 1.20190312-1
pve-firewall: 3.0-20
pve-firmware: 2.0-6
pve-ha-manager: 2.0-9
pve-i18n: 1.1-4
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 2.12.1-3
pve-xtermjs: 3.12.0-1
qemu-server: 5.0-50
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
 
At the time of this happening, the host had 10~GB RAM available.
Not all of that memory was available. You're running the node with no extra memory left, eg. for backups or caching.
 
Not all of that memory was available. You're running the node with no extra memory left, eg. for backups or caching.

Uhm, but is the VM, showing 8.36GB instead of 16GB, when ballooning is enabled normal (free -h)?
 
Going by the numbers in the Web GUI, the RAM usages add up to 40GB, but the host shows 49G used.
 
Alright so here's the thing. Proxmox web GUI shows that a VM is using 2GB RAM. But in htop, it's using 41% mem (26GB). Any idea why this is happening?
 
Both. The RAM usage on the node shows the usage of the KVM process running the VM instance and with ballooning, this may very well be ~9GiB (or less, depends on the lower limit). Inside the VM, the kernel shows its own usage. These may be different.
 
  • Like
Reactions: SagnikS

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!