你在使用。net程序时使用过哪些分析器,你特别推荐哪一个?
当前回答
其他人已经介绍了性能分析,但是是关于内存分析 我目前正在评估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中添加了对未处理的一次性对象的堆栈跟踪和跟踪,我认为没有必要使用其他任何东西。
其他回答
我以前跟红门的侧写师合作过。帮我完成了任务。
AQTime是合理的,但有一点学习曲线,并且不像Team Suite中内置的那样容易使用
我在一个大型的c#应用程序中发现了很多问题。
通常情况下,问题发生在启动或关机过程中,因为正在加载插件,并且正在创建、销毁、序列化或反序列化大数据结构。它们通常不止一次地被创建和初始化,并且更改处理程序被添加了多次,这进一步加剧了问题。
在这种情况下,程序可能非常缓慢,以至于只有2个样本就足以确定错误的方法/函数/属性调用位点。
不要忘记nProf -一个非常好的免费分析器。
我发现JetBrains的dotTrace Profiler是。net和他们的ASP的一个很好的分析工具。NET模式就是质量。
推荐文章
- 防止在ASP中缓存。NET MVC中使用属性的特定操作
- 转换为值类型'Int32'失败,因为物化值为空
- c#中有任何连接字符串解析器吗?
- 在Linq中转换int到字符串到实体的问题
- 是否可以动态编译和执行c#代码片段?
- 创建自定义MSBuild任务时,如何从c#代码获取当前项目目录?
- MSBuild路径
- c#和Java的主要区别是什么?
- 在c#中创建一个特定时区的DateTime
- .NET中的属性是什么?
- csproj文件中的“Service Include”是干什么用的?
- 如何使用try catch进行异常处理是最佳实践
- 替换字符串中第一次出现的模式
- .NET中字节的字面后缀?
- 如何处理AccessViolationException