Dypso
Dypso

Reputation: 563

C# : how to understand the result of this memory dump

We have made a dump of a c# (.Net fmk 4.5.1) that is using to much memory. We suspect a memory leak, and all the memory seems to be held by the usage of MEF.

Here is the object (ContractService.ContratSingletonMgr) which is holding the more memory:

1c0eeeec 728ee2db System.Net.TimerThread.ThreadProc()
    ebp+50: 1c0eeef0 (interior)
        ->  11bfc4e0 System.Object[]
        ->  05c1cbc0 System.ComponentModel.Composition.Hosting.CompositionContainer
        ->  05d92c78 System.EventHandler`1[[System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs, System.ComponentModel.Composition]]
        ->  05d92c58 System.Object[]
        ->  05c1d04c System.EventHandler`1[[System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs, System.ComponentModel.Composition]]
        ->  05c1cce4 System.ComponentModel.Composition.Hosting.CatalogExportProvider
        ->  05c1cdbc System.Collections.Generic.HashSet`1[[System.IDisposable, mscorlib]]
        ->  93011010 System.Collections.Generic.HashSet`1+Slot[[System.IDisposable, mscorlib]][]
        ->  049f86a4 System.ComponentModel.Composition.ReflectionModel.DisposableReflectionComposablePart
        ->  049f86fc ContractService.ContratSingletonMgr

I do not understand how to fix the problem: I think I have to unsubscribe the CompositionContainer ExportsChangeEvent; but I have double checked my code and I do not have any subscription to this event...

As for the System.Net.TimerThread.ThreadProc: does that mean that the code is causing a memory leak while using a timer object?

Upvotes: 1

Views: 135

Answers (0)

Related Questions