Monitoring memory usage ...

  • Thread starter Thread starter Remote_User
  • Start date Start date
R

Remote_User

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..
 
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>
 
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.
 
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.
 
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.
 
Back
Top