什么样的战略和工具,可用于查找内存泄漏在.NET有用吗? [英] What strategies and tools are useful for finding memory leaks in .NET?
问题描述
我写C ++ 10年。我遇到的内存问题,但它们可以固定的努力的合理费用。
I wrote C++ for 10 years. I encountered memory problems, but they could be fixed with a reasonable amount of effort.
在过去的几年中,我一直在写C#。我发现我仍然获得大量内存的问题。他们是难以诊断和修复因非determinancy,因为C#的理念是,你不应该担心这样的事情,当你十分肯定做的。
For the last couple of years I've been writing C#. I find I still get lots of memory problems. They're difficult to diagnose and fix due to the non-determinancy, and because the C# philosophy is that you shouldn't have to worry about such things when you very definitely do.
一个特别的问题,我觉得是,我必须明确地处置和清理一切都在code。如果我不这样做,那么内存分析器真的不帮助,因为有这么多谷壳浮你找不到内的所有数据的泄漏,他们正试图告诉你。我不知道如果我有错误的想法,如果我已经有了该工具是不是最好的。
One particular problem I find is that I have to explicitly dispose and cleanup everything in code. If I don't, then the memory profilers don't really help because there is so much chaff floating about you can't find a leak within all the data they're trying to show you. I wonder if I've got the wrong idea, or if the tool I've got isn't the best.
什么样的策略和工具,是解决在.NET内存泄漏有用吗?
What kind of strategies and tools are useful for tackling memory leaks in .NET?
推荐答案
我用赛特的 MemProfiler 时,我怀疑有内存泄漏。
I use Scitech's MemProfiler when I suspect a memory leak.
到目前为止,我发现它是非常可靠和强大。它救上至少有一次我的熏肉。
So far, I have found it to be very reliable and powerful. It has saved my bacon on at least one occasion.
GC的工作相当不错,在.NET国际海事组织,但就像任何其他语言或平台,如果你写不好code,不好的事情发生。
The GC works very well in .NET IMO, but just like any other language or platform, if you write bad code, bad things happen.
这篇关于什么样的战略和工具,可用于查找内存泄漏在.NET有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!