Reputation: 1803
Running ANTS Memory Profiler on my WPF application shows a path to memory leak which goes through System.Windows.Forms.Integration.AvalonAdapter
:
GC...--> WPF User Control --> System.Windows.Forms.Integration.AvalonAdapter --> System.Windows.Media.ImageBrush --> System.Windows.Media.Imaging.BitmapImage --> System.IO.MemoryStream --> System.Byte[]
Has anyone any idea about what this System.Windows.Forms.Integration.AvalonAdapter
points to?
Upvotes: 3
Views: 1801
Reputation: 66531
Weird nobody finished answering here.
Yes, if you host a wpf control in an ElementHost, AvalonAdapter will create a Bitmap for the background of the control. While this is not technically a memory leak, it does take up a surprising amount of memory (Bitmaps are heavy).
This doesn't happen if you're not hosting.
I haven't yet discovered if there's a workaround (other than stop hosting).
Upvotes: 1
Reputation: 174299
What exactly do you want to know? It is an internal class that is used by ElementHost
and two other internal classes (ElementHostAutomationPeer
and ElementHostPropertyMap
).
Upvotes: 1