[Mono-dev] Obtain the available memory

Paul F. Johnson paul at all-the-johnsons.co.uk
Thu Aug 25 05:21:06 EDT 2005


Hi,

> I have seen that the PerformanceCounter class is yet unimplemented in mono,
> yet, I would like to emulate with mono, the following 
> 
> <code>
> PerformanceCounter counter =
> 	new PerformanceCounter("Memory", "Available Bytes");
> </code>
> 
> There is the possibility to resort to command-line and to parse the output
> of the "top -b" command, but I feel that this option is very poor because
> the "top" output is not standardised at all (also this solution may yield
> very poor performance).

I'm not sure what you mean with the top output not being standardised
(it certainly wouldn't work on machines which didn't have the top
program). You may be right over the performance hit though.

> What would you suggest to get such information on mono?

Wait until PerformanceCounter is implemented? Memory is handled
differently by different hardware, it's therefore very hard to get a
standardised method.

TTFN

Paul
-- 
"Logic, my dear Zoe, is merely the ability to be wrong with authority" -
Dr Who




More information about the Mono-devel-list mailing list