locked
How to check what type of objects are allocated in my application? RRS feed

  • Question

  • Hi

     

    I have WinFroms .NET 3.5 app. I want check what types of objects are allocated and how many are there. I can do it using CLR Profiler but I would like to be able to just attach to process and check these information. CLR Profiler does not have option to attach to running process.

    I know that there is WinDbg tool but there is a lot of options and I could not find option that lets check what types of objects are allocated and how many there are.

    Does anybody know how to do this?

    Regards


    kicaj
    Wednesday, March 2, 2011 3:56 PM

Answers

  • I'm afraid that you have no other choice but to use windbg. CLR profiler doesn't support attach because .NET 3.5 doesn't support attach so I suspect all other profilers will have the same problem (note that .NET 4 supports attach).

    There are quite a few articles on the net about how to use windbg to investigate memory leaks in .NET. For example this one:

    http://msdn.microsoft.com/en-us/magazine/cc163528.aspx

    To point you in the right direction: the command you need is !dumpheap.

    Wednesday, March 2, 2011 4:13 PM