This is a migrated thread and some comments may be shown as answers.

RadGridView cause memory leak when disposed in RadPane without bringing it to view

8 Answers 342 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Iron
Joel asked on 06 Jan 2018, 04:28 PM

I am using 2017.1.117.40

Here is the scenario:
1. Create 6 RadPanes using MVVM - TestListView, TestPropertyView, TestRestulView, TestGraphView, TestActionView & CorrelationMeasurementView

2. Only TestListView, TestResultView are visible when RadDocking is loaded while the rest are not.

3. Click on a Dispose button. All RadPanes are visually removed from RadDocking.

4. Make a memory profile using dotMemory.

5. TestListView, TestResultView & TestPropertyView are properly disposed. While TestActionView, TestGraphView & CorrelationMeasurementView (all with R adGridView defined) are still being retained in the memory.

6. When remove RadGridView reference from TestListView, then run through the same step to dispose RadDocking & RadPanes, TestActionView is properly disposed from the memory.

7. Another test is to select TestActionView once after RadDocking has loaded. Then click Dispose button. TestActionView can be properly disposed.

 

p/s: sorry, i can't provide any sample project at this moment for you to reproduce the problem.

8 Answers, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 1
Iron
answered on 06 Jan 2018, 04:33 PM
Here is the RadGridView definition in TestListView.xaml:

<!-- ActionItem Records -->
<telerik:RadGridView Grid.Row="0" Margin="4"
             GroupRenderMode="Flat"
             ShowGroupPanel="False"
             ItemsSource="{Binding SelectedTestActionTable, Mode=OneWay}"
             RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False"
             AutoGenerateColumns="False"
             IsReadOnly="True"
             CanUserReorderColumns ="False"
             CanUserInsertRows="False"
             CanUserDeleteRows="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TestLongName}" Header="Test Long Name"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomTestName}" Header="Custom Test Name"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding UoM}" Header="Unit"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TestResult}" Header="Test Result" CellStyleSelector="{StaticResource myStyle}"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TestItemAlgoTime}" Header="Test Item Algo Time (ms)"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Status}" Header="Status"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
 
<!-- Test Statistic Table -->
<telerik:RadGridView Grid.Row="2" Margin="4"
             GroupRenderMode="Flat"
             ShowGroupPanel="False"
             RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False"
             ItemsSource="{Binding TestStatisticTable, Mode=OneWay}"
             AutoGenerateColumns="True"
             IsReadOnly="True"
             CanUserReorderColumns ="False"
             CanUserInsertRows="False"
             CanUserDeleteRows="False"/>
0
Joel
Top achievements
Rank 1
Iron
answered on 10 Jan 2018, 02:44 AM
I would like to follow up on this issue.
0
Ivan Ivanov
Telerik team
answered on 10 Jan 2018, 04:42 PM
Hi,

I looked through the given files, but I cannot to surely relate the observed leak to a known memory issue. However, I noticed that the view that displays path to GC.Root contains an instance of Timer as a retainer for RadGridView. Can you please confirm whether you have any custom timers in your application logic. Additionally, there are few timers that are used in RadGridView's logic. Two of them are enabled by default: one is related to text search and the other to property changed aggregation. Can you please try setting CanUserSearch and IsPropertyChangedAggregationEnabled to false and check whether there is any change in the memory footprint?

Regards,
Ivan Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Joel
Top achievements
Rank 1
Iron
answered on 11 Jan 2018, 02:27 AM

Hi,

  Unfortunately the retention is still there when i set CanUserSearch and IsPropertyChangedAggregationEnabled to false for all RadGridView.

  I have attached the TimeQueue Creation Stack snapshot. Please have a look.

  Allow me to reiterate, with the RadPanes brought into view, the disposal is working perfectly. But when they were not brought into view, their instances were retained in the memory.

0
Joel
Top achievements
Rank 1
Iron
answered on 11 Jan 2018, 02:33 AM
Here is the RadDocking definition:

<telerik:RadDocking x:Name="radDockTestPanel" AllowDragReorder="True"
                    Grid.Row="1"
                    HasDocumentHost="False" telerik:RadDocking.SerializationTag="layoutXml"
                    PanesSource="{Binding TestPanelCollection, Mode=OneWay}">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <cal:ActionMessage MethodName="LoadLayout">
                <cal:Parameter Value="{Binding ElementName=radDockTestPanel}"/>
            </cal:ActionMessage>
        </i:EventTrigger>
        <i:EventTrigger EventName="PaneStateChange">
            <cal:ActionMessage MethodName="PaneStateChange">
                <cal:Parameter Value="$eventArgs"/>
            </cal:ActionMessage>
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <telerik:RadDocking.DockingPanesFactory>
        <behavior:CustomDockingPanesFactory/>
    </telerik:RadDocking.DockingPanesFactory>
    <telerik:RadSplitContainer InitialPosition="DockedLeft" telerik:RadDocking.SerializationTag="leftSplitter">
        <telerik:RadPaneGroup  telerik:RadDocking.SerializationTag="leftGroup" Tag="leftGroup"/>
    </telerik:RadSplitContainer>
    <telerik:RadSplitContainer InitialPosition="DockedTop" telerik:RadDocking.SerializationTag="topSplitter">
        <telerik:RadPaneGroup telerik:RadDocking.SerializationTag="topGroup" Tag="topGroup"/>
    </telerik:RadSplitContainer>
    <telerik:RadSplitContainer InitialPosition="DockedRight" telerik:RadDocking.SerializationTag="rightSplitter">
        <telerik:RadPaneGroup  telerik:RadDocking.SerializationTag="rightGroup" Tag="rightGroup"/>
    </telerik:RadSplitContainer>
    <telerik:RadSplitContainer InitialPosition="DockedBottom" telerik:RadDocking.SerializationTag="bottomSplitter">
        <telerik:RadPaneGroup  telerik:RadDocking.SerializationTag="bottomGroup" Tag="bottomGroup"/>
    </telerik:RadSplitContainer>
</telerik:RadDocking>

 

Here is the RadDocking layout xml file:

<?xml version="1.0" encoding="utf-8"?>
<RadDocking SerializationTag="layoutXml">
    <SplitContainers>
        <RadSplitContainer Dock="DockedLeft" SerializationTag="leftSplitter" Width="280" Orientation="Vertical">
            <Items>
                <RadPaneGroup SerializationTag="leftGroup" SelectedIndex="0">
                    <Items>
                        <RadPane SerializationTag="Test List" IsDockable="True" Header="Test List" CanUserClose="False" />
                    </Items>
                </RadPaneGroup>
                <RadPaneGroup SerializationTag="leftGroup">
                    <Items>
                        <RadPane SerializationTag="Test Properties" IsDockable="True" Header="Test Properties" CanUserClose="False" />
                    </Items>
                </RadPaneGroup>
            </Items>
        </RadSplitContainer>
        <RadSplitContainer Dock="DockedTop" SerializationTag="topSplitter" >
            <Items>
                <RadPaneGroup SerializationTag="topGroup" SelectedIndex="0">
                    <Items>
                        <RadPane SerializationTag="Test Result" IsDockable="True" Header="Test Result" CanUserClose="False" />
                        <RadPane SerializationTag="Test Graph" IsDockable="True" Header="Test Graph" CanUserClose="False" />
                        <RadPane SerializationTag="Test Action" IsDockable="True" Header="Test Action" CanUserClose="False" />
                        <RadPane SerializationTag="Correlation Measurement" IsDockable="True" Header="Correlation Measurement" CanUserClose="False" />
                    </Items>
                </RadPaneGroup>
            </Items>
        </RadSplitContainer>
    </SplitContainers>
</RadDocking>

 

0
Joel
Top achievements
Rank 1
Iron
answered on 11 Jan 2018, 07:28 AM

I have submitted a support ticket ID: 1147984 

Please have a look.

0
Ivan Ivanov
Telerik team
answered on 15 Jan 2018, 03:10 PM
Hi,

I just dropped a line in the support ticket. Please, let us continue our communication there. Eventually, I will share the resolution here so that the community can benefit.

Regards,
Ivan Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Joel
Top achievements
Rank 1
Iron
answered on 22 May 2018, 09:39 AM
I would like to update this post by saying that the latest telerik version 2018.2.515.40 has fixed all the memory leak issues.
Tags
GridView
Asked by
Joel
Top achievements
Rank 1
Iron
Answers by
Joel
Top achievements
Rank 1
Iron
Ivan Ivanov
Telerik team
Share this question
or