<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi, all <div><br></div><div>I am trying to get used memory of a running vm using libvirt and then to calculate the memory usage, but with no luck.</div><div><br></div><div>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.</div><div> </div><div>2. When I turned to virDomainMemoryStats, I can only get two values : <span style="background-color: rgb(255, 255, 255); color: rgb(102, 102, 102); font-size: 12px; line-height: 18px; white-space: pre-wrap;">Current balloon value and </span><span style="background-color: rgb(255, 255, 255); color: rgb(102, 102, 102); font-size: 12px; line-height: 18px; white-space: pre-wrap;"> </span><span style="color: rgb(102, 102, 102); font-size: 12px; !
 line-height: 18px; white-space: pre-wrap; margin: 0px; padding: 0px;">Resident Set Size of the process running the domain. (for kvm 0.14.1 and libvirt 1.0.2)</span></div><div><span style="color: rgb(102, 102, 102); font-size: 12px; line-height: 18px; white-space: pre-wrap; margin: 0px; padding: 0px;"><br></span></div><div>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") </div><div><br></div><div>Any hints? </div><div><br></div><div>Many thanks!<br><br><div><font class="ecxApple-style-span" face="΢ÈíÑźÚ" size="2">Z. Zhang</font></div><font class="ecxApple-style-span" face="΢ÈíÑźÚ" size="2">National Research Center for intelligent Computing Systems,</font><div><font class="ecxApple-style-span" face="΢ÈíÑźÚ" size="2">ICT, Chinese Academy of Sciences </font><br>
<div style="font-family:\005fae\008f6f\0096c5\009ed1;font-size:10pt">
<div> </div></div></div></div>                                         </div></body>
</html>