<div dir="ltr">

            <br>
            

<div>
    <div class="" itemprop="text">

<p>I am trying to get stats of Domains running under XEN hypervisor.
I used Libvirt function for this purpose. I am trying to understand output for Memory. Domain running is Fedora-22 with 1GB Ram.
Here is my code</p>

<pre><code><span style="background-color:rgb(204,204,204)">y = virDomainGetInfo(allDomain, &info);
if (y == -1)
    printf("Errorl\n");
else {
    printf("Max Memory: %lu\n", info.maxMem);
    printf("Memory: %lu", info.memory);
}</span>
</code></pre>

<p>I get output as</p>

<pre><code><span style="background-color:rgb(204,204,204)"><b>Max Memory: 1048576
Memory: 1048576</b></span>
</code></pre>

<p>Now, as per <a href="http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInfo" rel="nofollow">Libvirt API</a>, <code>info.memory</code> should return the memory in KBytes used by the domain.
My Question is, if <code>info.memory</code> returns memory used and my 
domain is using complete 100% of Max Memory or not? Also I tried to 
create Domain with memory varying from 128MB to 2GB with same effect. I 
also tried to run some applications in Domain but Memory usage return by
 given function does not change.
Any help or guidance will be much appreciated.</p>
    </div></div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"> <br><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><b><span style="font-size:12pt;color:rgb(79,129,189)">Regards,<u></u><u></u></span></b></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><b><span style="font-size:12pt;color:rgb(79,129,189)"><u></u> <u></u></span></b></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><b><span style="font-size:12pt;color:rgb(79,129,189)">Aleem Akhtar </span></b></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><b><span style="font-size:12pt;color:rgb(79,129,189)">Research Assistant | HPC-Lab | SEECS<u></u></span></b></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:12pt;color:rgb(31,73,125)">National University of Sciences & Technology<u></u><u></u></span></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:12pt;color:rgb(31,73,125)">Sector H-12, Islamabad<u></u><u></u></span></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:12pt;color:rgb(31,73,125)">Email:</span><span style="font-size:12pt"> <a href="mailto:aleem.akhtar@seecs.nust.edu.pk" style="color:rgb(17,85,204)" target="_blank">aleem.akhtar@seecs.nust.edu.pk</a></span></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:12pt"><a href="mailto:aleem.akhtar@seecs.nust.edu.pk" style="color:rgb(17,85,204)" target="_blank"></a></span></p><p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-size:12pt;color:rgb(31,73,125)"></span><span style="font-size:12pt"></span><span style="font-size:12pt;color:rgb(31,73,125)">Website: </span><span style="font-size:12pt"><a href="http://aleemakhtar.com/" style="color:rgb(17,85,204)" target="_blank">aleemakhtar.com</a></span></p></div></div></div>
</div>