We use a RadTileList as our main navigation component. Today we noticed that our app's memory consumption only ever increases when opening modules and never decreases when closing them. When tracing memory usage with DotMemory (using the Key retention paths feature), I noticed that the retention path to the leaked module viewmodels seems to be rooted in the RadTileList component (see the attached screen shot).
A few implementation details:
- We are wrapping our modules in a class called "OpenedModule" (as you might guess from the attached image)
- The RadTileList is databound to an ObservableCollection<OpenedModule> via its ItemsSource
- We do not use grouping
- Closing a module results in the module's "OpenedModule" instance being removed from the ObservableCollection
This is the xaml we use to instantiate the TileList:
<telerik:RadTileList x:Name="NavigationRadTileList" ItemsSource="{Binding OpenedModules, Mode=OneWay}" CanUserSelect="False" TilePlaceHolderSide="90" behaviors:DisableTileListRightClickBehavior.IsEnabled="True" ItemTemplate="{StaticResource NavigationTileListTemplate}"> <telerik:RadTileList.Resources> <Style TargetType="{x:Type telerik:Tile}" BasedOn="{StaticResource NavigationTileStyle}" /> </telerik:RadTileList.Resources> </telerik:RadTileList>
Judging by the result from dotMemory, it looks like the TileGroup's children are somehow cached in an ordered list which is not updated when an item is removed?
Best Regards,
Simon Müller