[Mono-dev] Obtain the available memory

Rafael Ferreira lists at ophion.org
Thu Aug 25 13:13:14 EDT 2005


Parsing the output of "top" would be a hideous solution. A slightly
better one would be to parse /proc/meminfo.  But that would be a linux
only implementation and it would have to be reimplemented on other
platforms. 

FYI, this discussion is better suited for the mono users list, not
mono-dev.

- raf 

On Thu, 2005-08-25 at 11:10 +0200, Joannes Vermorel wrote:
> 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).
> 
> Somehow mono do know already (I guess) such information at least for the GC
> purpose. 
> 
> What would you suggest to get such information on mono?
> 
> Thanks in advance,
> Joannès
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 




More information about the Mono-devel-list mailing list