[Nottingham] Process CPU and memory usage?

Peter Chang Peter.Chang at nottingham.ac.uk
Tue Sep 23 00:01:16 UTC 2008


Martin,

> So how do you get 'realtime' process stats? (Of /currently/ running
> processes.)

Not sure what you mean? If you want to sample the stats at regular 
intervals then just call ps/pstree repeatedly with a sleep between calls.
How frequently do you want to sample?

[...]
> Sorry, but the top/ps/pstree and parse their output seems to be rather
> expensively clunky. Then also, scanning through /proc is also
> expensively clunky...

If you look at their source, they actually share a library of functions - 
in Fedora 9, the procps rpm contains /lib/libproc-3.2.7.so. So you could 
write your own routines.

> Any other ideas?

Patch the kernel?!?

Peter

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the Nottingham mailing list