मैं एक ऐसे अनुप्रयोग को डीबग करने पर काम कर रहा हूं जो पागल की तरह स्मृति को रिसाव करता है; इनमें से अधिकांश पिन किए गए ऑब्जेक्ट्स से विखंडन के कारण प्रतीत होता है (एक लिखने योग्य बिटमैप में डाउनलोड छवि डेटा)। हालांकि, मैं जानबूझकर जीसी। हैंडल या ऐसा कुछ भी नहीं कर रहा हूं। मैं बस MemoryStream
में डेटा स्टोर करता हूं, और इसे इस तरह संदर्भित करता हूं।सिल्वरलाइट में किसी ऑब्जेक्ट को स्मृति में "पिन" क्या कर सकता है?
मेमोरी में कौन से ऑपरेशन पिन डेटा, जो स्पष्ट रूप से ऐसा नहीं कहता है? साथ ही, WinDbg का उपयोग करके इसे पिन करने के लिए मैं कैसे पा सकता हूं?
संपादित करें: प्रति अनुरोध, यहां एक में से एक का एक (थोड़ा sanitized) आउटपुट है! एक सिस्टम पर जीसीआरयूटी। मुफ्त मेमोरी के एक बड़े ब्लॉक के निकट INT32 सरणी। यह सभी बड़े मुक्त ब्लॉक का प्रतिनिधि है।
संपादित करें 2: मेरे नए दोस्त WinDbg और एसओएस के साथ समय बिताने के बाद, मैंने पाया कि WriteableBitmaps
और MemoryStream
वस्तुओं, कर रहे हैं दोनों 'पिन किए गए', और स्मृति विखंडन को रोकने के लिए ध्यान से आवंटित किया जाना चाहिए। एक स्पष्टीकरण के लिए स्वीकृत उत्तर से आलेख पढ़ें कि क्यों इसे करने की आवश्यकता है।
DOMAIN(1AC72358):HANDLE(Pinned):72c12f8:Root: 174c5e20(System.Object[])->
16533060(Project.ProjectParts.PartContainer)->
167fe554(Project.ProjectParts.Part.PartActivity)->
167d21d8(Project.ProjectParts.Sprites.Graphic)->
16770f28(System.Windows.Controls.Canvas)->
16770e1c(System.Windows.Controls.Canvas)->
16770ee4(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
1680e778(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
16770f9c(System.Windows.Controls.Canvas)->
16819114(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
16819160(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
16818df4(System.Windows.Controls.Canvas)->
16818e58(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
16819f10(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
168194c4(System.Windows.Controls.Canvas)->
16819528(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
16819574(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
16819370(System.Windows.Controls.Image)->
21c82138(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
21c82184(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
168195dc(System.Windows.Media.Imaging.WriteableBitmap)->
21c7ce2c(System.Int32[])
DOMAIN(1AC72358):HANDLE(AsyncPinned):72c1dfc:Root: 166bae48(System.Threading.OverlappedData)->
1654d448(System.Threading.IOCompletionCallback)->
1654c29c(System.Net.Sockets.SocketAsyncEventArgs)->
1654bad4(System.Net.Sockets.Socket+StaticConnectAsyncState)->
1654ba40(System.Net.Sockets.SocketAsyncEventArgs)->
1654b684(System.ServiceModel.Channels.SocketConnectionInitiator+ConnectAsyncResult)->
1654b414(System.ServiceModel.Channels.ConnectionPoolHelper+EstablishConnectionAsyncResult)->
1654b3b0(System.ServiceModel.Channels.ClientFramingDuplexSessionChannel+OpenAsyncResult)->
1654b380(System.ServiceModel.Channels.CommunicationObject+OpenAsyncResult)->
1654b330(System.ServiceModel.Channels.CommunicationObject+OpenAsyncResult)->
1654b0f4(System.ServiceModel.Channels.ServiceChannel+SendAsyncResult)->
1654b070(System.ServiceModel.ClientBase`1+AsyncOperationContext[[Cassandra.Common.WCF.IAsyncWcfRequestProcessor, Cassandra.Common.Silverlight]])->
1654b05c(System.ComponentModel.AsyncOperation)->
1654b04c(Project.Common.IoC.InvokeAsyncCompletedEventRequestsArgs)->
1654afec(System.Action`1[[Project.Common.IoC.ProcessRequestsAsyncCompletedArgsEx, Project.Common.SL]])->
1654afc8(Project.Common.IoC.AsyncRequestDispatcherEx+<>c__DisplayClass1)->
1654afa0(Project.Common.IoC.NetResponseReceiver)->
1653408c(System.Action`2[[Cassandra.Common.ExceptionInfo, Cassandra.Common.Silverlight],[Cassandra.Common.ExceptionType, Cassandra.Common.Silverlight]])->
16533ffc(Project.ProjectParts.ILE.Services.EngineProxyService+<>c__DisplayClass5)->
16533fdc(System.Action`1[[Cassandra.Common.ReceivedResponses, Cassandra.Common.Silverlight]])->
16533fbc(Project.ProjectParts.ILE.Services.IEngineProxyExtensions+<>c__DisplayClass1`2[[Project.Services.RequestsAndResponses.ListMediaServersByTokenRequest, Project.Services.RequestsAndResponses.Silverlight],[Project.Services.RequestsAndResponses.ListInstitutionMediaServersResponse, Project.Services.RequestsAndResponses.Silverlight]])->
16533f9c(System.Action`1[[Project.Services.RequestsAndResponses.ListInstitutionMediaServersResponse, Project.Services.RequestsAndResponses.Silverlight]])->
1650a2a0(Project.ProjectParts.ILE.MainPage)->
1674ea0c(Project.ProjectParts.ActivityTimer)->
165330a4(Project.ProjectParts.PauseManager)->
165330bc(System.Collections.Generic.List`1[[Project.ProjectParts.IPausable, ActivityFramework]])->
166a8610(System.Object[])->
167ca858(Project.ProjectParts.ActivityTimer)->
167ca838(Project.ProjectParts.ActivityTimerEventHandler)->
16533060(Project.ProjectParts.PartContainer)->
167fe554(Project.ProjectParts.Part.PartActivity)->
167d21d8(Project.ProjectParts.Sprites.Graphic)->
16770f28(System.Windows.Controls.Canvas)->
16770e1c(System.Windows.Controls.Canvas)->
16770ee4(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
1680e778(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
16770f9c(System.Windows.Controls.Canvas)->
16819114(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
16819160(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
16818df4(System.Windows.Controls.Canvas)->
16818e58(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
16819f10(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
168194c4(System.Windows.Controls.Canvas)->
16819528(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
16819574(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
16819370(System.Windows.Controls.Image)->
21c82138(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
21c82184(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
168195dc(System.Windows.Media.Imaging.WriteableBitmap)->
21c7ce2c(System.Int32[])
DOMAIN(1AC72358):HANDLE(Pinned):72c2b18:Root: 21c7ce2c(System.Int32[])
आप "writablebitmap मेमोरी लीक" के लिए Google करना चाहते हैं, मुझे कुछ समय पहले इसके बारे में पढ़ना याद है। – Denis
मैंने उनको देखा है; और वे सभी मेरे मुकाबले अलग-अलग मामले लगते हैं, या एसएल 3 के बाद से छः रहे हैं। –
क्या आप उस वस्तु के विरुद्ध '! Gcroot 'चला सकते हैं, जिसे आप सोचते हैं और इसे अपने प्रश्न में जोड़ते हैं? –