From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 962181FF0B7 for ; Mon, 30 Nov 2026 11:22:33 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BC3D4216F9; Mon, 30 Nov 2026 11:22:30 +0100 (CET) From: Jonas Theisen 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 Message-ID: <20261130102217.70307-1-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796034145110 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.066 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YBJSZBRT3BKKOHOLYHYNQW7PKIXTOOE5 X-Message-ID-Hash: YBJSZBRT3BKKOHOLYHYNQW7PKIXTOOE5 X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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