[Gllug] Memory Usage

Daniel P. Berrange dan at berrange.com
Mon Mar 10 23:21:25 UTC 2008


On Mon, Mar 10, 2008 at 10:48:15PM +0000, Stephen Nelson-Smith wrote:
> Hello,
> 
> We had a strange case where a 12G machine with a xen kernel, and 5 x
> 2GB VMs appeared not to release the 10G of RAM once the vms had been
> stopped.  I had to reboot the machine to get that memory back.
> 
> Have I missed something?  Is there some "stop vms and reallocate the
> memory" command that  I missed?

Do not confuse the memory available to the hypervisor with the memory
available to the Dom0 / aka host OS. When you first boot, all the memory
available to the hypervisor is allocated to the Dom0.  When you start a
guest OS, memory is taken away from Dom0 and given to the guest. When
you then stop the guest, the memory is *not* given back to Dom0, but it
is still free as far as the hypervisor is concerned. You have to explicitly
give it back to Dom0 if you want to use it again i nthe host OS.

If you have libvirt installed then look at output of 'virsh nodeinfo'
to see total RAM on the machine, and 'virsh dominfo <NAME>' to see that
allocated to individual guests. Or better yet install 'virt-top' which
shows system wide stats in a friendly manner.

Regards,
Dan.
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080310/bdeaa56f/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list