[libvirt-users] With no luck with virDomainGetInfo and virDomainMemoryStats for memory usage of a running vm

张章 zhang_zhang at live.com
Thu Feb 28 12:42:37 UTC 2013


Hi, all 
I am trying to get used memory of a running vm using libvirt and then to calculate the memory usage, but with no luck.
1.The used memory returned by virDomainGetInfo is equal to max memory with no virtio balloon driver set.  When using virtio balloon driver and setting currentMemory less than memory in the xml,  the used memory returned by virDomainGetInfo is nearly equal to currentMemroy. Again, I can't get the memory used by vm. 2. When I turned to virDomainMemoryStats, I can only get two values : Current balloon value and  Resident Set Size of the process running the domain. (for kvm 0.14.1 and libvirt 1.0.2)
That's not what I want.  I only need to know how much memory used by the running vm, so I can calculate the memory usage of this vm. (like the used memory return by cmd "free -m") 
Any hints? 
Many thanks!

Z. ZhangNational Research Center for intelligent Computing Systems,ICT, Chinese Academy of Sciences 


  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130228/0808dbb1/attachment.htm>


More information about the libvirt-users mailing list