<div dir="ltr">Hello,<div>I need to get how much memory is used by a guest system, in order to implement some monitoring function which tells me if the system is overstressed.</div><div><br></div><div>I am currently using java apis and the binding which was suggested to me was</div>
<div>Domain.memoryStats();</div><div><br></div><div>This is a binding to  <span class="" style="font-weight:bold;white-space:nowrap;color:rgb(72,61,139)">int</span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)">       virDomainMemoryStats            (</span><span class="" style="font-weight:bold;white-space:nowrap;color:rgb(72,61,139)"><a href="http://libvirt.org/html/libvirt-libvirt.html#virDomainPtr" style="color:rgb(86,104,102);text-decoration:none">virDomainPtr</a></span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"> dom, </span><span class="" style="font-weight:bold;white-space:nowrap;color:rgb(72,61,139)"><a href="http://libvirt.org/html/libvirt-libvirt.html#virDomainMemoryStatPtr" style="color:rgb(86,104,102);text-decoration:none">virDomainMemoryStatPtr</a></span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"> stats,</span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"> </span><span class="" style="font-weight:bold;white-space:nowrap;color:rgb(72,61,139)">unsigned int</span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"> nr_stats,</span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"> </span><span class="" style="font-weight:bold;white-space:nowrap;color:rgb(72,61,139)">unsigned int</span><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"> flags).</span></div>
<div><span style="background-color:rgb(238,238,238);color:rgb(0,0,0)"><br></span></div><div><font color="#000000"><span style="background-color:rgb(238,238,238)">Problem is that it returns me just tags 0,6 and 7.</span></font></div>
<div><font color="#000000"><span style="background-color:rgb(238,238,238)">Looking at the documentation I see they are not what I am looking for...I would rather need 4 (</span></font>VIR_DOMAIN_MEMORY_STAT_UNUSED) and 5 (VIR_DOMAIN_MEMORY_STAT_AVAILABLE).</div>
<div><br></div><div>Is there a way to set them?</div></div>