dna86
dna86

Reputation: 407

Examining the .NET heap at runtime

Is there any way to walk the heap from a .NET application? I have a Silverlight application and want to be able to examine the heap for memory leaks. I thought it would be nice to implement a debugging popup window that would display the contents of the heap. I have looked through the .NET API namespaces and can't find anything relevant.

Upvotes: 3

Views: 437

Answers (2)

GRGodoi
GRGodoi

Reputation: 1996

You can also try the SysInternals's tool ProcessExplorer. It have a tab named .NET where you can find a lot of specific data about .NET applications (memory, garbage collector activity, etc). Every time I suspect that my code is leaking memory I use this tool to check and understand what is happening.

Upvotes: 0

Reed Copsey
Reed Copsey

Reputation: 564441

You can use the SOS Debugging Extension to examine the managed memory allocations in your program.

Here is a blog post walking through how to do this with Silverlight.

Upvotes: 1

Related Questions