Filter our leaks of .Net Framework Code

I have a super simple C# WPF sample project to learn how to use dotMemory. The project has a startup Window with just one button. The Click of the button shows the window below. If I open and close the window a couple of times dotMemory shows me some leaks. Are these bugs in the .net Framework? And if yes, can I filter them out somehow so I see only the problems in my code?


This is the first leak it shows:

Event handlers leak inspection

Type: TextEditor+TextEditorShutDownListener
Retained Size: 864
Count: 24


Here ist the XAML of the Window:

<Window x:Class="WpfMemoryProfilingTester.MainWindow"
        Title="MainWindow" Height="850" Width="1525" d:DataContext="{d:DesignInstance local:MainWindowViewModel}">
        <DataTemplate x:Key="ItemTemplate">
            <Grid d:DataContext="{d:DesignInstance local:ItemViewModel}">
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="200" />

                <TextBox Grid.Column="0" Text="{Binding Name}" />
                <TextBox Grid.Column="1" Text="{Binding Telefon}" />
    <Grid Margin="20">
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        <ComboBox Grid.Row="0" ItemsSource="{Binding SelectItems}" />
        <ListBox x:Name="ListBox" Grid.Row="1" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource ItemTemplate}" />

Attached Uploaded File: (Contains the Sample App Project)

Comment actions Permalink

Hello Markus,

I can't see attached file here, probably it too large to upload.

Could you please upload your sample to our FTP server: 


Comment actions Permalink

Hallo Anna, I uploaded it via ftp. Name: (175 KB)

Comment actions Permalink

Yes, some .NET Framework assemblies can contain "Event handler" leaks. TextEditor+TextEditorShutDownListener contains in PresentationFramework assembly and you can't fix the leak in this case.

"Event handlers leak" inspection shows you a possible issues in your code which can cause a great memory usage. But you do not need to fix all of them if they do not expend a lot of memory.

Comment actions Permalink

About filtering: you can open "Group by assembly" view, select your assemblies and open them in separate object set which will contain types from your code.

Comment actions Permalink

Hello Anna, thanks for the quick answer! Just one question: Can I filter out those errors somehow in dotMemory? (I have the job during the next weeks to find memory issuses in a quite big Application and it would be fine to filter out those .Net issues there...)

Comment actions Permalink


Currently, dotMemory doesn't contain special functionality to filter system types, but you can use the way which I have described above.

We have a feature request:

You're welcome to vote for it.

Comment actions Permalink

Klicking on the Link for Eventhandler Issues on the snapshot view to show all items and than filter by namespace is fine...Thanks - good idea!

Filtering system types would not help here, because I use third party controls like Telerik and they also have issues... (And if I click the link to the feature request it shows me "Access denied")

Thank you for your very quick help!!!


Please sign in to leave a comment.