[libvirt] Need Info on virNodeGetCellsFreeMemory

Hi, how to find the memory utilization of the whole which is running with some guest? By libvirt I can only see virNodeGetCellsFreeMemory relevant API, But didn't understand how to use it. Thanks & Regards --Ajish

On Thu, Aug 28, 2008 at 02:02:19AM +0530, ajishrao wrote:
Hi, how to find the memory utilization of the whole which is running with some guest? By libvirt I can only see virNodeGetCellsFreeMemory relevant API, But didn't understand how to use it.
The answer varies depending on just what sort of memory usage you're trying to measure. - virNodeInfo - provides the total RAM installed in the host machine - virDomainInfo - provides info for a single VM While in theory you could sum the memory for each active domain, and subtract it from the node info data, this doesn't take into account memory usage from processes running in the host OS. Hence we have - virNodeGetFreeMemory - returns total free memory on the host - virNodeGetCellsFreeMemory - returns free memory on one or more NUMA memory cells Intel x86_64 machines don't current do NUMA, so the latter isn't very interesting unless you're on AMD x86 or Intel ia64 machines. If you don't know/care about NUMA, then just call virNodeGetFreeMemory Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Aug 28, 2008 at 02:02:19AM +0530, ajishrao wrote:
how to find the memory utilization of the whole which is running with some guest? By libvirt I can only see virNodeGetCellsFreeMemory relevant API, But didn't understand how to use it.
Also, working out how much memory a guest is really using is within the purview of the virt-mem[1] & crash[2] projects. Rich. [1] http://et.redhat.com/~rjones/virt-mem [2] http://people.redhat.com/anderson/ -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
participants (3)
-
ajishrao
-
Daniel P. Berrange
-
Richard W.M. Jones