I use DotTrace as memory profiler. I wonder how it can filter circular incoming references?
我使用DotTrace作为内存分析器。我想知道它如何过滤循环传入引用?
As for the scenarios that I want to see who the hell holds reference to my object and keep it alive, those circular references, especially event handlers are not of interest but the true bad reference is often hidden among them.
至于我想看看谁控制我的对象并使其保持活动的场景,那些循环引用,尤其是事件处理程序并不重要,但真正的错误引用通常隐藏在它们之间。
Additionally, what is the meaning of "Show Held in New Tab" and "Show Reachable in New Tab" and do these help identifying circular references?
此外,“在新标签中显示保持”和“在新标签中显示可访问”的含义是什么,这些有助于识别循环引用吗?
Many thanks to any answer.
非常感谢任何答案。
1 个解决方案
#1
What do you mean by "circular references"? If I recall correctly, there's no way to achieve a memory leak through circular references as the GC would identify and destroy the whole sub-graph of inter-connected objects.
你是什么意思“循环引用”?如果我没记错的话,通过循环引用无法实现内存泄漏,因为GC会识别并破坏相互连接对象的整个子图。
If, however, any of the objects in the sub-graph has a live reference, the whole graph survives. So you should probably take a closer look to all of the objects you suspect and find the one that is incorrectly referenced.
但是,如果子图中的任何对象具有实时引用,则整个图存活。因此,您应该仔细查看您怀疑的所有对象,并找到错误引用的对象。
#1
What do you mean by "circular references"? If I recall correctly, there's no way to achieve a memory leak through circular references as the GC would identify and destroy the whole sub-graph of inter-connected objects.
你是什么意思“循环引用”?如果我没记错的话,通过循环引用无法实现内存泄漏,因为GC会识别并破坏相互连接对象的整个子图。
If, however, any of the objects in the sub-graph has a live reference, the whole graph survives. So you should probably take a closer look to all of the objects you suspect and find the one that is incorrectly referenced.
但是,如果子图中的任何对象具有实时引用,则整个图存活。因此,您应该仔细查看您怀疑的所有对象,并找到错误引用的对象。