[SOLVED] Host memory usage of VM not correct?

comfreak

Active Member
May 20, 2020
46
13
28
35
Hi,

my Proxmox hosts reports a memory usage of 25% in htop for a Ubuntu 20.04 VM. I assigned 16GB to that VM which is 25% of my total 64GB host RAM.

htop in the VM reports ~1-2GB usage (inkl. cache etc.). The rest is free. Qemu guest tools are installed and the Proxmox Web UI also reports the 1-2GB usage.

If I shutdown the VM, the hosts releases the 16GB of active used RAM.

If I start the VM again, 16GB are instantly marked as used on the host.

Why is this?
 
Last edited:
Hello,

I would guess you are mixing up virtual and physical RAM. In htop, compare VIRT and RES. RES is probably much smaller :)
 
Hi,

hm, I think not really?:)
17.8G <-> 16.4G

Screenshot 1: Proxmox Host
Screenshot 2: VM

Edit: Version Infos
Host:
proxmox-ve: 7.1-1 (running kernel: 5.13.19-4-pve)
pve-manager: 7.1-10 (running version: 7.1-10/6ddebafe)
pve-kernel-helper: 7.1-12
pve-kernel-5.13: 7.1-7
pve-kernel-5.11: 7.0-10
pve-kernel-5.13.19-4-pve: 5.13.19-9
pve-kernel-5.13.19-3-pve: 5.13.19-7
pve-kernel-5.13.19-2-pve: 5.13.19-4
pve-kernel-5.13.19-1-pve: 5.13.19-3
pve-kernel-5.11.22-7-pve: 5.11.22-12
pve-kernel-5.11.22-5-pve: 5.11.22-10
pve-kernel-5.11.22-4-pve: 5.11.22-9
pve-kernel-5.11.22-1-pve: 5.11.22-2
ceph-fuse: 15.2.13-pve1
corosync: 3.1.5-pve2
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.22-pve2
libproxmox-acme-perl: 1.4.1
libproxmox-backup-qemu0: 1.2.0-1
libpve-access-control: 7.1-6
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.1-3
libpve-guest-common-perl: 4.1-1
libpve-http-server-perl: 4.1-1
libpve-storage-perl: 7.1-1
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 4.0.11-1
lxcfs: 4.0.11-pve1
novnc-pve: 1.3.0-2
proxmox-backup-client: 2.1.5-1
proxmox-backup-file-restore: 2.1.5-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.4-6
pve-cluster: 7.1-3
pve-container: 4.1-4
pve-docs: 7.1-2
pve-edk2-firmware: 3.20210831-2
pve-firewall: 4.2-5
pve-firmware: 3.3-5
pve-ha-manager: 3.3-3
pve-i18n: 2.6-2
pve-qemu-kvm: 6.1.1-2
pve-xtermjs: 4.16.0-1
qemu-server: 7.1-4
smartmontools: 7.2-1
spiceterm: 3.2-2
swtpm: 0.7.0~rc1+2
vncterm: 1.7-1
zfsutils-linux: 2.1.2-pve1

VM:
Fully updated.

root@jellyfin:~# uname -a
Linux jellyfin 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

root@jellyfin:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
 

Attachments

  • Screenshot_1.jpg
    Screenshot_1.jpg
    29.4 KB · Views: 22
  • Screenshot_2.jpg
    Screenshot_2.jpg
    24.9 KB · Views: 21
  • Screenshot_3.jpg
    Screenshot_3.jpg
    31.1 KB · Views: 21
Last edited:
Hi, please share your VM config. Do you use any PCI devices?
 
Hi,

ah, yes I should have mentioned that..,I passthrough a Nvidia P400...


Code:
root@proxmox:~# cat /etc/pve/qemu-server/106.conf
agent: 1
boot: order=scsi0;ide2;net0
cores: 8
cpu: host,hidden=1
hostpci0: 0000:0a:00.0,pcie=1
hostpci1: 0000:0a:00.1
ide2: none,media=cdrom
machine: q35
memory: 16384
meta: creation-qemu=6.1.0,ctime=1644003371
name: jellyfin
net0: virtio=42:C8:FC:CA:B9:8D,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
scsi0: local-zfs:vm-106-disk-0,discard=on,size=32G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=8fe64c9d-0920-4b8b-a236-684b61d76f5a
sockets: 1
vmgenid: 35338040-73e8-405b-8799-b7c82928b728
 
Yea, that's (most likely) the culprit. Because PCI devices can directly access arbitrary memory, the whole memory range needs to be mapped.
 
Got it, thanks.

I could try removing the passthrough and see, if it is the culprit, but thats okay for me now.

I will try to reduce the RAM of the VM.