I've just noticed that Linux VMs get less usable memory than that configured in the VM. For example, for a VM with 512MiB, top/htop/free shows just 466MiB (lost aprox 9%). For a 4GiB VM, only 3915.3MiB is available to the OS (lost 2.1%). A 128MiB VM will lose like 23% and give just 98.3MiB for Linux to use.
With the exact same VM but running Win10 or Win2019, task manager and resource monitor shows all the memory (4GiB). Maybe Windows is rounding up the values?
Using
512MB=488,281MiB
4096MB=3906,25MiB
I'm probably overlooking something on this one, but still wondering why Linux VMs get less memory than that configured and running in QEMU.
edit:
- This is the VM config:
- I've seen this on PVE8, PVE7.4. PVE7.2 and PVE6.3 with a variety of kernel and QEMU versions.
With the exact same VM but running Win10 or Win2019, task manager and resource monitor shows all the memory (4GiB). Maybe Windows is rounding up the values?
Using
qm showcmd
I can see a parameter "-m 4096". AFAIK, the webUI, Linux top/htop/free and Windows task manager show values in MiB/GiB. I think that QEMU command line uses MB/GB. Still, the unit conversions don't match the values in Linux:512MB=488,281MiB
4096MB=3906,25MiB
I'm probably overlooking something on this one, but still wondering why Linux VMs get less memory than that configured and running in QEMU.
edit:
- This is the VM config:
Code:
agent: 1,fstrim_cloned_disks=1
boot: order=scsi0;ide2;net0
cores: 3
cpu: host
ide2: none,media=cdrom
machine: q35
memory: 2048
name: Memtesting
net0: virtio=2A:A9:1E:93:1E:01,bridge=vmbr1
numa: 1
ostype: l26
protection: 1
scsi0: NVME:vm-980001-disk-0,discard=on,iothread=1,size=20G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=356a49b8-2109-4637-b03e-3933af8e211b
sockets: 1
vmgenid: 25fe2ff2-8910-43b4-a246-b0f366733d5d
- I've seen this on PVE8, PVE7.4. PVE7.2 and PVE6.3 with a variety of kernel and QEMU versions.
Last edited: