开发者

Silverlight WinDg Memory Release Issue

I have used WinDbg succesfully on a number of occasions to track down and fix memory leaks (or more accurately the CLRs inability to garbage collect a released object), but am stuck with one particular control. The control is displayed within a child window and when the window is closed a reference to the control remains and cannot be garbage collected. I have resolved what I believe to be the majority of the issues that could have caused the leak, but the !gcroot of the affected object is not clear (to me at least) as to what is still holding on to this object. The ouput is always the same regardless of the content being presented in the child window:

DOMAIN(03FB7238):HANDLE(Pinned):79b12f8:Root: 06704260(System.Object[])-> 05719f00(System.Collections.Generic.Dic开发者_高级运维tionary2[[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)

If anyone has any ideas about what could potentially be the problem, or if you require more information, please let me know.

Kind Regards, Chris


Statics are stored via a pinned Object[], so it could be a static reference to a dictionary of IntPtr, Object rooting it. You could try to look into the dictionary to see if the other entries provides any useful clues.

However, given the IntPtr I would expect this to be something the Silverlight runtime uses internally.

I would go through the roots and look for any types used by the application and verify that they are all okay.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜