Memory size discrepancies between settings, qui-domains and in-VM size


I notice there are discrepancies between memory related numbers.

A qube with maxmem=1024 shows 1008 MB RAM in qui-domains and free --mebi inside that same qube shows 936 MiB.

It seems the difference between maxmem and qui-domains’s number is always 16 MB. OTOH, the difference with free is not a fixed number and varies with the memory size.

At first, I thought this might be due to the multiple-byte units but calculations show it is not that.

Can someone please explain the reason for these discrepancies?

Also, what is the reason for seeing qubes created by the installer having memory settings aligned to powers of 10 (e.g. 4000 MB) rather than powers of 2 (4096)?


Crickets… :cricket:
I guess the answer is that the numbers are calculated differently (as multiples of 1000 or 1024). And one can read the sources and find out. But I’m not up for the task today so let’s hope a benevolent developer can shed some light with less effort.

No, it is not that.

If I turn off memory balancing, the 16 MiB difference disappears. The in-qube RAM is still less though.