[libvirt] KVM Domain memory and disk usage

Eric Blake eblake at redhat.com
Fri Feb 28 20:34:45 UTC 2014


On 02/28/2014 01:21 PM, Qiang Fu wrote:
> Hi Eric,

[please don't top-post on technical lists]

> 
> When we run the "virsh dommemstat" cmd, it returns us two values, actual
> and rss.

'virsh dommemstat' calls the virDomainMemoryStats() API, which in turn
reports information from multiple places.  First, it is issuing the qemu
monitor command 'qom-get' on the balloon device from the guest, where it
then populates these fields: swap-in, swap-out, major-fault,
minor-fault, unused, and available.

Next, it uses /proc/PID/stat parsing to learn statistics about the
memory usage of the overall qemu process; this is where it populates the
rss field.

> 
> I am referring to the rss here. I believe this is the qemu process in the
> host. So you mean it could be greater than the maximum memory allocation
> ("memory" in "virsh dumpxml") to the guest? Why?

The RSS of the qemu process includes overhead memory that qemu itself
allocated to manage the guest, even though the guest does not see that
much memory.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140228/d7b8e858/attachment-0001.sig>


More information about the libvir-list mailing list