你在使用。net程序时使用过哪些分析器,你特别推荐哪一个?


当前回答

(完全披露)

虽然还不像这里列出的其他一些。net内存分析器那样功能齐全,但市场上有一个新的入口叫做JustTrace。它是由Telerik制作的,它的主要目标是让所有类型的应用(web/Silverlight/桌面)的跟踪/分析更容易、更快。

如果您曾经发现使用其他工具分析和优化令人生畏或速度较慢,那么JustTrace可能值得一试。

其他回答

蚂蚁分析器。我用过的不多,但我对ANTS并没有什么抱怨。可视化真的很有帮助。

如果你正在寻找一些快速,简单,免费的东西,http://code.google.com/p/slimtune/似乎做的很好。

如果许可是一个问题,您可以尝试WINDBG进行内存分析

Intel®VTune™性能分析仪快速采样

其他人已经介绍了性能分析,但是是关于内存分析 我目前正在评估Scitech . net Memory Profiler 3.1和ANTS Memory Profiler 5.1(2009年9月的当前版本)。一两年前我试过JetBrains,它不如ANTS(内存分析)那么好,所以这次我就不麻烦了。从网站上看,它似乎没有其他两个相同的内存分析功能。

ANTS和Scitech内存分析器都具有其他内存分析器所不具有的特性,因此哪个是最好的取决于您的偏好。一般来说,Scitech提供了更详细的信息,而ANTS在识别泄漏对象方面确实令人难以置信。总的来说,我更喜欢ANTS,因为它在识别可能的泄漏方面非常快。

根据我的经验,以下是每种方法的主要优点和缺点:

ANTS和Scitech .NET内存分析器的共同特征

实时分析功能 他们的网站上有优秀的教学视频 使用方便 合理的性能(明显比没有附加分析器时慢,但不至于让你感到沮丧) 显示泄漏对象的实例 基本上他们都做得很好

ANTS

One-click filters to find common leaks including: objects kept alive only by event handlers, objects that are disposed but still live and objects that are only being kept alive by a reference from a disposed object. This is probably the killer feature of ANTS - finding leaks is incredibly fast because of this. In my experience, the majority of leaks are caused by event handlers not being unhooked and ANTS just takes you straight to these objects. Awesome. Object retention graph. While the same info is available in Scitech, it's much easier to interpret in ANTS. Shows size with children in addition to size of the object itself (but only when an instance is selected unfortunately, not in the overall class list). Better integration to Visual Studio (right-click on graph to jump to file)

Scitech .NET内存分析器

Shows stack trace when object was allocated. This is really useful for objects that are allocated in lots of different places. With ANTS it is difficult to determine exactly where the leaked object was created. Shows count of disposable objects that were not disposed. While not indicative of a leak, it does identify opportunities to fix this problem and improve your application performance as a result of faster garbage collection. More detailed filtering options (several columns can be filtered independently). Presents info on total objects created (including those garbage collected). ANTS only shows 'live' object stats. This makes it easier to analyze and tune overall application performance (eg. identify where lots of objects being created unnecessarily that aren't necessarily leaking).

总的来说,我认为ANTS可以帮助您更快地找到泄漏的内容,而Scitech则提供了关于您的整体应用程序内存性能和单个对象的更多细节,一旦您知道要查看哪些内容(例如。创建时的堆栈跟踪)。如果在ANTS中添加了对未处理的一次性对象的堆栈跟踪和跟踪,我认为没有必要使用其他任何东西。