Hi All,
I am trying to check the memory usage for a process using C#
(.NET 1.1). I found out several properties in the Process class that
was useful. But, my question is after i tried that out and compared
the result with that indicating in the Windows Task Manager they
didn't match?
Could anyone suggest any other options?
Thanks..
Michael Nemtsev - 08 Jul 2007 17:26 GMT
Hello Remote_User,
Use performance counters http://msdn2.microsoft.com/en-us/library/x2tyfybc.aspx
---
WBR, Michael Nemtsev [C# MVP].
[.Net Tips & Tricks]: http://msmvps.com/blogs/laflour/pages/net-tips-amp-tricks.aspx
My blog: http://spaces.live.com/laflour/ Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
R> Hi All,
R> I am trying to check the memory usage for a process using C#
R> (.NET 1.1). I found out several properties in the Process class that
R> was useful. But, my question is after i tried that out and compared
R> the result with that indicating in the Windows Task Manager they
R> didn't match?
R>
R> Could anyone suggest any other options?
R>
R> Thanks..
R>
Remote_User - 09 Jul 2007 03:51 GMT
Hi Michael,
Thanks for the reply. But, in the msdn link you
provided, it was mainly referring to the counters that refers to the
Garbage Collector.
Thanks.
-----
> Hello Remote_User,
>
[quoted text clipped - 19 lines]
> R> Thanks..
> R>
Bob Johnson - 09 Jul 2007 04:39 GMT
RE:
<< Thanks for the reply. But...>>
So, while you're googling for yourself, and in addition to performance
counters, you might also search for WMI and WQL which also give you
extensive access to hardware, OS, etc info.
Remote_User - 09 Jul 2007 06:55 GMT
Hi,
I have to use .NET 1.1 and WMI/WQL are for .NET 2.0 and higher.
---
> RE:
> << Thanks for the reply. But...>>
>
> So, while you're googling for yourself, and in addition to performance
> counters, you might also search for WMI and WQL which also give you
> extensive access to hardware, OS, etc info.
Chris Mullins [MVP] - 10 Jul 2007 01:41 GMT
The value reported by Task Manager is the Working Set. This is very
different from what you think it is.
For figuring out your .Net memory consumption, use the .Net Performance
Counters.
If you're trying to figure out where you memory is going, use a Memory
Profiler, such as the one from Scitech.

Signature
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins
> Hi All,
> I am trying to check the memory usage for a process using C#
[quoted text clipped - 6 lines]
>
> Thanks..