Jérôme Gallard
2011-Nov-23 08:48 UTC
[libvirt-users] Difference between "Max Memory" and "Used Memory"
Hello, I am new on this mailing list, so If I do something wrong, don't hesitate to tell me :-) I am using the following version of libvirt : Compiled against library: libvir 0.8.8 Using library: libvir 0.8.8 Using API: QEMU 0.8.8 Running hypervisor: QEMU 0.14.0 I would like to understand the difference between "Max Memory" and "Used Memory" returned by a "virsh dominfo" command. In my configuration both values are equal. This surprises me because my VM is not using all its memory. Perhaps I miss something ? Thank you very much for your help. Regards, J?r?me -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20111123/354d8a2c/attachment.htm>
Eric Blake
2011-Nov-23 12:27 UTC
[libvirt-users] Difference between "Max Memory" and "Used Memory"
On 11/23/2011 01:48 AM, J?r?me Gallard wrote:> Hello, > > I am new on this mailing list, so If I do something wrong, don't hesitate > to tell me :-)Welcome to the community.> > I am using the following version of libvirt : > Compiled against library: libvir 0.8.8 > Using library: libvir 0.8.8 > Using API: QEMU 0.8.8 > Running hypervisor: QEMU 0.14.0 > > I would like to understand the difference between "Max Memory" and "Used > Memory" returned by a "virsh dominfo" command. In my configuration both > values are equal. This surprises me because my VM is not using all its > memory. Perhaps I miss something ?"Max Memory" is the cap amount of memory reserved for the domain at guest startup; qemu will not let the guest exceed this amount, but for typical guests, it starts the guest with this much memory reserved (the host's memory is used on-demand, though, so unless the guest actually touches this much memory, the host does not necessarily give up this much memory). "Used Memory" refers to the amount of memory that the guest informs the host that it is using. This requires guest cooperation, via the 'virtio memory balloon' device, so if the guest does not support this device, qemu must treat it the same as "Max Memory". On hosts that do support memory ballooning (most Linux guests support it by default, and you can install virtio drivers for Windows guests), then you can request that the guest use less memory by way of the 'virsh setmem' command (virDomainSetMemoryFlags API call), at which point libvirt issues a command for the guest to use its memory balloon device in order to reduce "Used Memory". -- Eric Blake eblake at 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: 620 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20111123/59c9a16f/attachment.sig>