[libvirt] How to get VM memory usage

Daniel P. Berrange berrange at redhat.com
Fri Apr 21 08:20:49 UTC 2017


On Fri, Apr 21, 2017 at 09:58:12AM +0800, wangyufeng at cloudguarding.com wrote:
> Hi Daniel,
> 
> In method 'GetInfo', we can only get memory and max memory. However I
> need to get used memory for calculating memory usage. The virsh command
> 'dommemstat' can obtain used memory, is there a method in libvirt-go to
> obtain used memory?

That command uses the virDomainMemoryStats() API call


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list