How to learn amount of memory used by the process at the current t

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to test .net class for memory leak presence. For this I want to know
how much memory is used before creating and after deleting class instance.
How can I do it? And could it help me find a memory leak in general? I know
about profilers, but I want to test a class automatically, may be using .net
profiler api. And there are also helpful GC functions like GC.GetTotalMemory,
GC.Collect, GC.WaitForPendingFinalizers. But I cann't think up something that
will work correct. Could you help me?

Thanks,
Alexey.
 
If the class does not use unmanaged resources, it has no memory leak. It
isn't possible.

There may be some profiling tools for COM+ apps that can help you if you are
using unmanaged resources.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top