all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Jonas Theisen <j.theisen@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager/qemu-server 0/2] fix memory usage reporting of VMs with an inflated balloon
Date: Mon, 30 Nov 2026 11:20:51 +0100	[thread overview]
Message-ID: <20261130102217.70307-1-j.theisen@proxmox.com> (raw)

The memory usage of a VM is calculated from the total and free memory
reported by the guest's balloon driver. The Windows driver keeps
reporting the full physical memory as total and accounts inflated
balloon pages as allocated, while the Linux driver removes them from
the total. With an inflated balloon, a Windows guest's reported usage
thus includes memory that the host already reclaimed, and the usage
graph can show more than the VM occupies on the host.

The qemu-server patch subtracts the part of the balloon that the guest
still includes in its total. It derives that from the reported values
rather than the OS type, so guests that already shrink their total are
not affected, and neither is auto-ballooning, which only uses the free
memory.

The pve-manager patch shows the reclaimed amount in the VM status
panel, so it is visible why the guest and host usage differ. It is
hidden while the balloon is not inflated. Showing the amount in the
memory graph as well would require a new RRD column, so this is left
out for now.

Tested on a Windows Server 2025 VM with 8 GiB of memory and a Debian
VM with 2 GiB, inflating the balloon to half of the memory each:

  VM       guest total  usage before  usage after  host usage
  Windows  8124 MiB     5406 MiB      1378 MiB     4129 MiB
  Debian    949 MiB      164 MiB       164 MiB      320 MiB

The patches do not depend on each other.


qemu-server:

Jonas Theisen (1):
  vmstatus: do not count memory reclaimed by the balloon as used

 src/PVE/QemuServer.pm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)


manager:

Jonas Theisen (1):
  ui: guest status: show memory reclaimed by the balloon device

 www/manager6/panel/GuestStatusView.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)


Summary over all repositories:
  2 files changed, 26 insertions(+), 2 deletions(-)

-- 
Generated by murpp 0.12.1




             reply	other threads:[~2026-11-30 10:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 10:20 Jonas Theisen [this message]
2026-11-30 10:20 ` [PATCH qemu-server 1/2] vmstatus: do not count memory reclaimed by the balloon as used Jonas Theisen
2026-11-30 10:20 ` [PATCH manager 2/2] ui: guest status: show memory reclaimed by the balloon device Jonas Theisen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130102217.70307-1-j.theisen@proxmox.com \
    --to=j.theisen@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal