4

Just curious, is it possible to find out, what items are generated while the program is running in stack and heap? Is there a tool or meachanism out there to identify memory usage in VS2010 C# (Silverlight)? Thanks,

Nair
  • 7,438
  • 10
  • 41
  • 69

3 Answers3

3

Yes, you can use the Visual Studio Profiler (or any other profiler).

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

Other memory profilers:

SO question: What Are Some Good .NET Profilers?

Community
  • 1
  • 1
robertos
  • 1,810
  • 10
  • 12
1

Its not built into Visual Studio, but you can use CLRProfiler to visualize allocations on the heap.

foson
  • 10,037
  • 2
  • 35
  • 53
0

Reference types are always allocated on the heap. I believe you can assume that value types are allocated on the stack. I don't know of any tools that will show your total stack usage, though.

You can use GC.GetTotalMemory() to determine your app's heap usage.

Cory Nelson
  • 29,236
  • 5
  • 72
  • 110