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


当前回答

我怀疑Visual Studio Team System自带的分析器是不是最好的分析器,但我发现它在很多情况下已经足够好了。除了维密所提供的,你还需要什么?

编辑:不幸的是,它只在VS团队系统中可用,但如果你有机会,它值得一试。

其他回答

如果你是ASP。你可以尝试MVCMiniProfiler (http://benjii.me/2011/07/using-the-mvc-mini-profiler-with-entity-framework/)

其他人已经介绍了性能分析,但是是关于内存分析 我目前正在评估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中添加了对未处理的一次性对象的堆栈跟踪和跟踪,我认为没有必要使用其他任何东西。

我一直在使用JetBrains dotTrace用于WinForms和控制台应用程序(尚未在ASP.net上测试),它工作得很好:

他们最近还增加了“个人许可证”,比企业许可证便宜得多。不过,如果有人知道一些更便宜甚至免费的,我也想听听:-)

AQTime是合理的,但有一点学习曲线,并且不像Team Suite中内置的那样容易使用

当前版本的SharpDevelop(3.1.1)有一个很好的集成分析器。它非常快,并且很好地集成到SharpDevelop IDE和它的NUnit运行器中。结果以灵活的树/列表样式显示(使用LINQ创建自己的选择)。双击显示的方法将直接跳转到源代码。