[Tmem-devel] tmem how to get current usage in megabytes?

Dan Magenheimer dan.magenheimer at oracle.com
Wed Aug 18 09:34:31 PDT 2010


> > > If i run domU with memory 5000 and maxmemory 60000 domU can shrink
> it
> > > memory to lower then minimum (for example to 1500), how can i get
> > > current memory usage of domU from hypervisor (in dom0) ?
> >
> > "xm list" has a bug that shows only the original amount of memory
> > for the machine.  I use "xentop" to show current memory usage.
> > If you have a recent upstream Xen "xl list" will work also.
> 
> Can i get current memory usage on tmem enabled domain with xen api?

Yes, both xentop and xl do this correctly, but I don't know the
API usage since I just use those tools directly.  Note that with
a bash/awk script, you can extract the memory usage from xentop with
something like:

xentop -v -b -i1 | grep <truncated_domain_name> | cut -c36-46

But I usually just watch xentop running in another window to
view dynamic memory size changes.

> Where i can find current memory usage of domain id 34 in this list?

You can't find it from tmem-list or from "free -m" in dom0
since tmem-list only provides tmem statistics, not ballooning
information; and "free -m" only shows memory information for
dom0 itself, not for other guests.

In domU, "free -m" first column "total" is the current memory
usage.  (But this doesn't work if your domU is already crashed :-)



More information about the Tmem-devel mailing list