当前位置: 动力学知识库 > 问答 > 编程问答 >

silverlight - How can I find out what items get generated in memory when debugging c#?

问题描述:

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,

网友答案:

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:

  • http://memprofiler.com
  • http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/
  • http://www.xteprofiler.com/ (supports Silverlight)

SO question: What Are Some Good .NET Profilers?

网友答案:

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

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: