【问题标题】:Silverlight WinDg Memory Release IssueSilverlight WinDg 内存释放问题
【发布时间】:2011-01-12 15:51:17
【问题描述】:

我曾多次成功地使用 WinDbg 来追踪和修复内存泄漏(或者更准确地说是 CLR 无法对已释放的对象进行垃圾收集),但我被一个特定的控件卡住了。该控件显示在子窗口中,当窗口关闭时,对该控件的引用仍然存在,并且不能被垃圾回收。我已经解决了我认为可能导致泄漏的大多数问题,但是受影响对象的 !gcroot 不清楚(至少对我来说)关于仍然保留该对象的内容。无论子窗口中显示的内容如何,​​输出始终相同:

DOMAIN(03FB7238):HANDLE(Pinned):79b12f8:Root: 06704260(System.Object[])-> 05719f00(System.Collections.Generic.Dictionary2[[System.IntPtr, mscorlib],[System.Object, mscorlib]])-> 067c1310(System.Collections.Generic.Dictionary2+Entry[[System.IntPtr, mscorlib],[System.Object, mscorlib]][])-> 064d42b0(System.Windows.Controls.Grid)-> 064d4314(System.Collections.Generic.Dictionary2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])-> 064d4360(System.Collections.Generic.Dictionary2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])-> 064d3860(System.Windows.Controls.Border)-> 064d4218(System.Collections.Generic.Dictionary2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])-> 064d4264(System.Collections.Generic.Dictionary2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])-> 064d3bfc(System.Windows.Controls.ContentPresenter)-> 064d3d64(System.Collections.Generic.Dictionary2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])-> 064d3db0(System.Collections.Generic.Dictionary2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])-> 064d3dec(System.Collections.Generic.Dictionary2[[System.UInt32, mscorlib],[System.Windows.DependencyObject, System.Windows]])-> 064d3e38(System.Collections.Generic.Dictionary2+Entry[[System.UInt32, mscorlib],[System.Windows.DependencyObject, System.Windows]][])-> 06490b04(Insurer.Analytics.SharedResources.Controls.HistoricalKPIViewerControl)

如果有人对可能出现的问题有任何想法,或者如果您需要更多信息,请告诉我。

亲切的问候, 克里斯

【问题讨论】:

    标签: debugging silverlight-4.0 windbg


    【解决方案1】:

    静态数据通过固定的Object[] 存储,因此它可以是对IntPtrObject 的字典的静态引用。您可以尝试查看字典以查看其他条目是否提供任何有用的线索。

    但是,考虑到IntPtr,我希望这是 Silverlight 运行时内部使用的东西。

    我会检查根源并查找应用程序使用的任何类型,并验证它们是否都正常。

    【讨论】:

    • Thanx Brian,我相信此问题与 Silverlight 运行时有关,因此已重新设计控件以规避此问题。现在一切都很好,GC 正在做它的工作。
    猜你喜欢
    • 1970-01-01
    • 2011-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-20
    • 2010-10-03
    相关资源
    最近更新 更多