Re: [Mono-dev] Obtain the available memory

2005-08-25 Thread Paul F. Johnson
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

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Obtain the available memory

2005-08-25 Thread Paolo Molaro
On 08/25/05 Joannes Vermorel wrote:
 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).

While PerformanceCounter is not implemented, on Linux you can read the
/proc/meminfo file:
~$ cat /proc/meminfo 
MemTotal:  1035740 kB
[...]

As for PerformanceCounter: as I suggested in the past, someone running
windows should collect the names, types, and meanings of the counters
that we should make available and write them all in one place.
When we'll have that doc, we'll implement the support in mono.

lupus

-- 
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list