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

Memory Leak

23 Answers 1041 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pat
Top achievements
Rank 1
Pat asked on 31 Mar 2011, 03:09 AM

Hi,

I have a WPF application. I am using Telerik controls v4.0.30319.

I am running into memory leaks using the RadGridView. The first scenario is straight forward, I am binding to a ViewModel’s Observable Collection but when I update the Collection it does not release the memory for the old objects. The second scenario I have created DataTemplate with Textbox’s in the rows and the RadGridView will not release the textbox’s.

<myViews:BaseUserControl xmlns:myViews="clr-namespace:EnconWPF.Views"

                         xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

                         x:Class="EnconWPF.Views.ScreenBdetl"

                         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

                         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

                         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

                         xmlns:my="clr-namespace:EnconWPF"

                         xmlns:myViewModel="clr-namespace:EnconWPF.ViewModels"

                         mc:Ignorable="d"

                         d:DesignWidth="950">

    <myViews:BaseUserControl.Resources>

        <Style TargetType="my:CoreTextBox"

               BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Windows7Theme, ElementType=TextBox}}" />

        <my:NullableStringConverter x:Key="NullableStringConverter" />

        <my:BwzConverter x:Key="BwzConverter" />

        <my:PhoneNumberConverter x:Key="PhoneNumberConverter" />

    </myViews:BaseUserControl.Resources>

    <Grid x:Name="LayoutRoot"

          Style="{StaticResource GradientBlueGridStyle}">

 

        <Grid>

            <Grid.RowDefinitions>

                <RowDefinition Height="85" />

                <RowDefinition Height="0" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="26" />

                <RowDefinition Height="30*" />

            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>

                <ColumnDefinition Width="20" />

                <ColumnDefinition Width="30" />

                <ColumnDefinition Width="*" />

                <ColumnDefinition Width="30" />

                <ColumnDefinition Width="20" />

            </Grid.ColumnDefinitions>

            <my:Toolbar  x:Name="toolBar"

                         Height="85"

                         Grid.Row="0"

                         Grid.Column="0"

                         Grid.ColumnSpan="5" />

            <TextBlock Text="{Binding ApplicationStrings.BROKER, Source={StaticResource ResourceWrapper}}"

                       Grid.Row="3"

                       Grid.Column="2"

                       Margin="10,0,0,0" />

            <my:CoreTextBox Grid.Row="3"

                            Grid.Column="2"

                            Margin="120,0,0,0"

                            Width="54"

                            Text="{Binding  Account.ACCOUNTNUMBER, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True, Converter={StaticResource BwzConverter}}"

                            IsReadOnly="True" Display="ModifyAdd"

                            IsTabStop="{Binding Path=IsControlTabStop}"

                            MaxLength="6"

                            TabIndex="1" />

            <my:CoreTextBox Grid.Row="3"

                            Grid.Column="2"

                            Margin="185,0,0,0"

                            Width="270"

                            Text="{Binding Account.CONDENSEDNAMEACT, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                            IsReadOnly="True" Display="ModifyAdd"

                            IsTabStop="{Binding Path=IsControlTabStop}"

                            MaxLength="30"

                            TabIndex="2" />

            <TextBlock Text="{Binding ApplicationStrings.BROKER_NUM, Source={StaticResource ResourceWrapper}}"

                       Grid.Row="5"

                       Grid.Column="2"

                       Margin="10,0,0,0" />

            <my:CoreTextBox  Grid.Row="5"

                             Grid.Column="2"

                             Margin="120,0,0,0"

                             MaxLength="30"

                             Width="270"

                             Text="{Binding Account.ACCOUNTNAME, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                             IsReadOnly="True" Display="ModifyAdd"

                             IsTabStop="{Binding Path=IsControlTabStop}"

                             TabIndex="4" />

            <TextBlock Text="{Binding ApplicationStrings.ADDRESS, Source={StaticResource ResourceWrapper}}"

                       Grid.Row="6"

                       Grid.Column="2"

                       Margin="10,0,0,0" />

            <my:CoreTextBox Grid.Row="6"

                            Grid.Column="2"

                            Margin="120,0,0,0"

                            MaxLength="30"

                            Width="270"

                            Text="{Binding Account.ADDRESS1, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                            IsReadOnly="True" Display="ModifyAdd"

                            IsTabStop="{Binding Path=IsControlTabStop}"

                            TabIndex="6" />

            <TextBlock Text=""

                       Grid.Row="7"

                       Grid.Column="2"

                       Margin="170,0,0,0" />

            <my:CoreTextBox Grid.Row="7"

                            Grid.Column="2"

                            Margin="120,0,0,0"

                            Width="270"

                            Height="24"

                            Text="{Binding Account.ADDRESS2, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                            IsReadOnly="True" Display="ModifyAdd"

                            IsTabStop="{Binding Path=IsControlTabStop}"

                            MaxLength="30"

                            TabIndex="7" />

            <TextBlock Text=""

                       Grid.Row="8"

                       Grid.Column="2"

                       Margin="170,0,0,0" />

            <my:CoreTextBox  Grid.Row="8"

                             Grid.Column="2"

                             Margin="120,0,0,0"

                             Width="270"

                             Text="{Binding Account.ADDRESS3, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                             IsReadOnly="True" Display="ModifyAdd"

                             IsTabStop="{Binding Path=IsControlTabStop}"

                             MaxLength="30"

                             TabIndex="8" />

            <TextBlock Text=""

                       Grid.Row="9"

                       Grid.Column="2"

                       Margin="170,0,0,0" />

            <my:CoreTextBox   Grid.Row="9"

                              Grid.Column="2"

                              Margin="120,0,0,0"

                              Width="270"

                              Text="{Binding Account.ADDRESS4, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                              IsReadOnly="True" Display="ModifyAdd"

                              IsTabStop="{Binding Path=IsControlTabStop}"

                              MaxLength="30"

                              TabIndex="9" />

            <TextBlock  Text="{Binding ApplicationStrings.PROVINCE, Source={StaticResource ResourceWrapper}}"

                        Grid.Row="10"

                        Grid.Column="2"

                        Margin="10,0,0,0" />

            <my:CoreTextBox   Grid.Row="10"

                              Grid.Column="2"

                              Margin="120,0,0,0"

                              MaxLength="2"

                              Width="26"

                              Text="{Binding Ml.ML_CODE_MAST, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                              IsEnabled="{Binding Path=IsControlEnabled}"

                              IsReadOnly="True"

                              Display="InquireModifyAdd"

                              IsTabStop="False"

                              TabIndex="10" />

            <TextBlock  Text=""

                        Grid.Row="10"

                        Grid.Column="2"

                        Margin="200,0,0,0"

                        Visibility="{Binding Path=IsHideInFind}" />

            <my:CoreTextBox Grid.Row="10"

                            Grid.Column="2"

                            Margin="180,0,0,0"

                            Width="180"

                            Text="{Binding Ml.ML_NAME_MAST, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                            IsEnabled="{Binding Path=IsControlEnabled}"

                            IsReadOnly="True"

                            Display="InquireModifyAdd"

                            IsTabStop="False"

                            MaxLength="20"

                            Visibility="{Binding Path=IsHideInFind}"

                            TabIndex="11" />

            <TextBlock  Text="{Binding ApplicationStrings.POSTAL, Source={StaticResource ResourceWrapper}}"

                        Grid.Row="10"

                        Grid.Column="2"

                        Margin="500,0,0,0" />

            <my:CoreTextBox   Grid.Row="10"

                              Grid.Column="2"

                              Margin="580,0,0,0"

                              MaxLength="10"

                              Width="90"

                              Text="{Binding Account.ZIPCODE, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                              IsReadOnly="True" Display="ModifyAdd"

                              IsTabStop="{Binding Path=IsControlTabStop}"

                              TabIndex="12" />

            <TextBlock  Text="{Binding ApplicationStrings.PHONE, Source={StaticResource ResourceWrapper}}"

                        Grid.Row="5"

                        Grid.Column="2"

                        Margin="500,0,0,0" />

            <my:CoreTextBox Grid.Row="5"

                            Grid.Column="2"

                            Margin="580,0,0,0"

                            Width="100"

                            Height="24"

                            HorizontalAlignment="Left"

                            FontSize="11"

                            Text="{Binding Account.PHONENUM, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True, Converter={StaticResource PhoneNumberConverter}}"

                            IsReadOnly="True" Display="ModifyAdd"

                            IsTabStop="{Binding Path=IsControlTabStop}"

                            MaxLength="12"

                            TabIndex="5" />

            <TextBlock  Text="{Binding ApplicationStrings.ACTDEAD, Source={StaticResource ResourceWrapper}}"

                        Grid.Row="3"

                        Grid.Column="2"

                        Margin="500,0,0,0" />

            <my:CoreTextBox Grid.Row="3"

                            Grid.Column="2"

                            Margin="580,0,0,0"

                            MaxLength="2"

                            Width="26"

                            Height="24"

                            HorizontalAlignment="Left"

                            FontSize="11"

                            Text="{Binding Account.ACTIVEDEAD, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                            IsReadOnly="True" Display="ModifyAdd"

                            IsTabStop="{Binding Path=IsControlTabStop}"

                            TabIndex="3" />

            <Border Width="Auto"

                    Height="25"

                    Grid.Row="12"

                    Grid.Column="1"

                    Grid.ColumnSpan="3"

                    CornerRadius="5,5,0,0"

                    Visibility="{Binding Path=IsHideInFind}"

                    Background="#FF112A5D" />

            <Button  Height="20"

                     x:Name="Append"

                     Width="20"

                     HorizontalAlignment="Left"

                     Grid.Column="1"

                     Margin="5,0,0,0"

                     Grid.Row="12"

                     ToolTipService.ToolTip="{Binding Source={StaticResource ResourceWrapper}, Path=ApplicationStrings.APPENDBUTTON}"

                     Style="{StaticResource AppendButtonStyle}"

                     Visibility="{Binding IsAppendVisible}"

                     Command="{Binding AppendCommand}">

            </Button>

            <Border Width="Auto"

                    Height="Auto"

                    CornerRadius="3"

                    Grid.Row="13"

                    Grid.Column="1"

                    Grid.ColumnSpan="3"

                    Grid.RowSpan="10"

                    HorizontalAlignment="Left"

                    Visibility="{Binding Path=IsHideInFind}">

 

            </Border>

            <telerik:RadGridView x:Name="SCREEN_BDETL_DetailList"

                                 Grid.Row="13"

                                 Grid.Column="1"

                                 Grid.ColumnSpan="3"

                                 Grid.RowSpan="12"

                                 Height="255"

                                 ItemsSource="{Binding BrokerCollection}"

                                 Visibility="{Binding Path=IsHideInFind}"

                                 ShowGroupPanel="True"

                                 IsEnabled="{Binding Path= IsControlEnabled}"

                                 Width="Auto"

                                 telerik:StyleManager.Theme="Windows7"

                                 VerticalAlignment="Top"

                                 AutoGenerateColumns="False"

                                 CanUserFreezeColumns="False"

                                 IsFilteringAllowed="True"

                                 IsReadOnly="True"

                                 RowIndicatorVisibility="Collapsed"

                                 FontFamily="Arial"

                                 IsTabStop="False"

                                 ScrollViewer.VerticalScrollBarVisibility="Auto"

                                 ScrollViewer.HorizontalScrollBarVisibility="Auto">

                <telerik:RadGridView.Resources>

                    <DataTemplate x:Key="EditButtonColumnResource">

                        <Button x:Name="EditRowCommand"

                                Style="{StaticResource GridImageButton}"

                                Command="{Binding DataContext.EditDetailCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"

                                CommandParameter="{Binding RelativeSource={RelativeSource Self}}">

                            <Button.Content>

                                <Image Source="/EnconWPF;component/Images/Toolbar/Edit.png"

                                       Width="13"

                                       Height="13"

                                       Stretch="Uniform"

                                       ToolTipService.ToolTip="{Binding Source={StaticResource ResourceWrapper}, Path=ApplicationStrings.EditButton}" />

                            </Button.Content>

                        </Button>

                    </DataTemplate>

                    <DataTemplate x:Key="DeptResourceColumn">

                        <my:CoreComboBox IsEditable="True"

                                         SelectedValue="{Binding Dept, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, Converter={StaticResource NullableStringConverter}}"

                                         IsReadOnly="True"

                                         Display="Inquire"

                                         Width="60"

                                         TabIndex="15"

                                         Values=",SRD,AE,COIN,DO,MAIN,ACCT" />

                    </DataTemplate>

                    <DataTemplate x:Key="FaxResourceColumn">

                        <my:CoreTextBox Text="{Binding Fax, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True, Converter={StaticResource PhoneNumberConverter}}"

                                        MaxLength="16"

                                        Width="124"

                                        TabIndex="16"

                                        Display="Inquire" />

                    </DataTemplate>

                    <DataTemplate x:Key="EmailResourceColumn">

                        <my:CoreTextBox Text="{Binding Email, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                                        MaxLength="80"

                                        Width="530"

                                        TabIndex="17"

                                        Display="Inquire" />

                    </DataTemplate>

                    <DataTemplate x:Key="TierResourceColumn">

                        <my:CoreTextBox Text="{Binding Tier, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                                        Width="50"

                                        TabIndex="18"

                                        Display="Inquire" />

                    </DataTemplate>

                    <DataTemplate x:Key="CancelColumnResource">

                        <Button x:Name="CancelRowCommand"

                                Style="{StaticResource GridImageButton}"

                                IsEnabled="{Binding IsAltered, Mode=TwoWay}"

                                Command="{Binding DataContext.CancelDetailCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"

                                CommandParameter="{Binding RelativeSource={RelativeSource Self}}">

                            <Button.Content>

                                <Image Source="/EnconWPF;component/Images/Toolbar/Undo.png"

                                       Width="13"

                                       Height="13"

                                       Stretch="Uniform"

                                       ToolTipService.ToolTip="{Binding Source={StaticResource ResourceWrapper}, Path=ApplicationStrings.CancelDetailButton}" />

                            </Button.Content>

 

                        </Button>

                    </DataTemplate>

                    <DataTemplate x:Key="DeleteColoumnResource"

                                  x:Name="DeleteColoumnResource">

                        <Button x:Name="DeleteRowCommand"

                                Style="{StaticResource GridImageButton}"

                                Command="{Binding DataContext.DeleteDetailCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"

                                CommandParameter="{Binding RelativeSource={RelativeSource Self}}">

                            <Button.Content>

                                <Image Source="/EnconWPF;component/Images/Toolbar/Delete.png"

                                       Width="13"

                                       Height="13"

                                       Stretch="Uniform"

                                       ToolTipService.ToolTip="{Binding Source={StaticResource ResourceWrapper}, Path=ApplicationStrings.DeleteDetailButton}" />

                            </Button.Content>

 

                        </Button>

                    </DataTemplate>

                </telerik:RadGridView.Resources>

 

 

                <telerik:RadGridView.Columns>

                    <telerik:GridViewColumn Width="30"

                                            CellTemplate="{StaticResource EditButtonColumnResource}">

                    </telerik:GridViewColumn>

                    <telerik:GridViewDataColumn Width="70"

                                                DataMemberBinding="{Binding Dept, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                                                IsSortable="True"

                                                CellTemplate="{StaticResource DeptResourceColumn}">

                        <telerik:GridViewDataColumn.Header>

                            <StackPanel>

                                <TextBlock Text="{Binding ApplicationStrings.DEPT, Source={StaticResource ResourceWrapper}}"

                                           Style="{StaticResource GridHeaderStyle}" />

                            </StackPanel>

                        </telerik:GridViewDataColumn.Header>

                    </telerik:GridViewDataColumn>

                    <telerik:GridViewDataColumn Width="134"

                                                DataMemberBinding="{Binding Fax, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                                                IsSortable="True"

                                                CellTemplate="{StaticResource FaxResourceColumn}">

                        <telerik:GridViewDataColumn.Header>

                            <StackPanel>

                                <TextBlock Text="{Binding ApplicationStrings.FAXNUMBER, Source={StaticResource ResourceWrapper}}"

                                           Style="{StaticResource GridHeaderStyle}" />

                            </StackPanel>

                        </telerik:GridViewDataColumn.Header>

                    </telerik:GridViewDataColumn>

                    <telerik:GridViewDataColumn Width="520"

                                                DataMemberBinding="{Binding Email, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                                                IsSortable="True"

                                                CellTemplate="{StaticResource EmailResourceColumn}">

                        <telerik:GridViewDataColumn.Header>

                            <StackPanel>

                                <TextBlock Text="{Binding ApplicationStrings.CONTACTEMAIL, Source={StaticResource ResourceWrapper}}"

                                           Style="{StaticResource GridHeaderStyle}" />

                            </StackPanel>

                        </telerik:GridViewDataColumn.Header>

                    </telerik:GridViewDataColumn>

                    <telerik:GridViewDataColumn Width="60"

                                                DataMemberBinding="{Binding Tier, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=True}"

                                                IsSortable="True"

                                                CellTemplate="{StaticResource TierResourceColumn}">

                        <telerik:GridViewDataColumn.Header>

                            <StackPanel>

                                <TextBlock Text="{Binding ApplicationStrings.TIER, Source={StaticResource ResourceWrapper}}"

                                           Style="{StaticResource GridHeaderStyle}" />

                            </StackPanel>

                        </telerik:GridViewDataColumn.Header>

                    </telerik:GridViewDataColumn>

                    <telerik:GridViewColumn Width="30"

                                            CellTemplate="{StaticResource CancelColumnResource}">

                    </telerik:GridViewColumn>

                    <telerik:GridViewColumn Width="30"

                                            CellTemplate="{StaticResource DeleteColoumnResource}">

                    </telerik:GridViewColumn>

                </telerik:RadGridView.Columns>

            </telerik:RadGridView>

        </Grid>

    </Grid>

</myViews:BaseUserControl>

 

 

Any help would be much appreciated; our company has used Telerik controls for all of our Silverlight projects and would like to continue using them for WPF once I have this figured out.

 

Pat

23 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Mar 2011, 07:36 AM
Hi,

 We believe that this version is related to the framework - not to our components. Can you post the grid assembly version?

Greetings,
Vlad
the Telerik team
0
Pat
Top achievements
Rank 1
answered on 31 Mar 2011, 12:40 PM
Hi Vlad,

Thank you for the quick response.
I do appologize as I am unclear what Assemble you are looking for, In case it is not the .Telerik Gridview I have listed all of the assemblies.

Microsoft.CSharp
PresentationCore
PresentationFramework
ReachFramework
System
System.ComponentModel.DataAnnotations
System.configuration
System.Core
System.Data
System.Data.DataSetExtension
System.Data.Entity
System.Drawing
System.Runtime.Serialization
System.Security
System.Xaml
System.Xml.Linq
Telerik.Windows.Controls

Telerik.Windows.Controls.Data

Telerik.Windows.Controls.DataVisualization

Telerik.Windows.Controls.GridView

Telerik.Windows.Controls.Input

Telerik.Windows.Controls.Navigation

Telerik.Windows.Data

WindowsBase.dll

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v4.0.0.0

v 2011.1.315.40

v 2011.1.315.40

v 2011.1.315.40

v 2011.1.315.40

v 2011.1.315.40

v 2011.1.315.40

v 2011.1.315.40

v 2011.1.315.40

v4.0.0.0

 

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319

v4.0.30319
v4.0.30319


Thank you 

0
Betsy
Top achievements
Rank 1
answered on 30 Aug 2011, 10:13 PM
Was there any update on this?  I am seeing something very similar using text boxes in the row details template.  App is freezing after scrolling a few times and memory usage just continously increases even when I am not interacting with the app at all.  Closing the grid does not release the memory, have to close the entire app.  I am using WPF 4.0, Telerik 2011.2.712.40.
0
Vlad
Telerik team
answered on 31 Aug 2011, 06:55 AM
Hello Heather,

 Can you send us an example where we can reproduce this?

Kind regards,
Vlad
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Victor
Top achievements
Rank 1
answered on 02 May 2012, 03:31 AM
Having same problem as original post. RadGridView binds to an ObservableCollection in the viewmodel but after update never releases old values that were in the collection.

Was this ever resolved? Could you please post any solution or work around for this type of issue.

My recent post on this issue is here:
http://www.telerik.com/community/forums/wpf/general-discussions/prism-telerick-memory-leak.aspx

Thanks in advance...

Victor
0
Rossen Hristov
Telerik team
answered on 02 May 2012, 12:22 PM
Hello,

Can you send us an example where we can reproduce this? 

All the best,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Victor
Top achievements
Rank 1
answered on 02 May 2012, 11:03 PM
Hi Ross,

I attached a retention graph from the ANTS memory profiler on the other thread - have you had a chance to look at it? I'll attach it here and another one since this is where you responded. The graph is a good example of the internal architecture of a Prism app and how Telerik fits into it. I see event handlers in Telerik namespaces and dispatch timers all of which are not in my code. All the information on WPF memory leaks tells us to dispose or release event handlers, call stop on dispatch timers, etc, but how do I do this with Telerik controls??? They seem to be holding on to objects from every update cycle.

Does anything look out of place with the attached graph?

I am not able to send you a sample to reproduce it since I do not have permission to do so.

My scenario is based on best practices from Microsoft including Prism 4.0, WPF 4.0, and the MVVM pattern. I am using

WPF Q1 2012 Radcontrols.


The Telerik charts and grids are long living Prism views and are updated once per minute via a bound ObservableCollection.

Based on solely the above information should the RadChart and/or RadGridView leak memory? If they have in the past, what was the solution?

BTW, this must be one of the most common use cases for your product. A dashboard desktop application using modularity via Prism to display charts and grids that dynamically update in real time. Right?

Victor
0
Rossen Hristov
Telerik team
answered on 03 May 2012, 08:17 AM
Hi,

I believe that you have already opened another support ticket for this problem. Let's try to keep the conversation in a single place (i.e. in the other support ticket), since it can become confusing.

All the best,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Igor
Top achievements
Rank 2
answered on 16 Dec 2012, 01:10 PM
Hi! 
is there any update on that problem?
was it fixed in the last build?
0
Vlad
Telerik team
answered on 17 Dec 2012, 07:40 AM
Hi,

 Can you post more info about the grid version and the problem at your end? 

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Igor
Top achievements
Rank 2
answered on 17 Dec 2012, 09:54 AM
Vlad, i am currently investigating into the problem, but the symptoms are same as described in the current topic.
I am not yet ready to provide the code to reproduce the problem.
Will keep you updated with it
0
Igor
Top achievements
Rank 2
answered on 17 Dec 2012, 12:47 PM
i have submitted the ticket on my problem with memory leak which i was able to reproduce against the latest internal build.
http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=641011

the soure code is attached.
0
Nedyalko Nikolov
Telerik team
answered on 18 Dec 2012, 01:19 PM
Hi,

I've profiled this application and I cannot detect a memory leak.
I'm attaching a snapshot from JustTrace memory profiler for a reference.

Greetings,
Nedyalko Nikolov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Igor
Top achievements
Rank 2
answered on 18 Dec 2012, 02:43 PM
I am doing some actions with the example, e.g. scrolling grid and expanding \ collapsing records to view details there.
Here how it looks on my side in JustTrace
0
Nedyalko Nikolov
Telerik team
answered on 19 Dec 2012, 08:56 AM
Hi,

Generally for such applications (with a continuous fast updates) it is quite natural that memory is increasing. For us important thing is if there is any pending element after Garbage Collector does its job (which in .NET you cannot count when GC will be triggered - of course you can do this manually). Indeed with your application (and with assemblies attached) there is a small memory increase, which according to me is a minimal and should not trouble you. However we've made some optimizations recently and my observations with our latest development assemblies is that the situation is even better.
Could you please test your scenario with our next internal build (usually our internal builds are uploaded every Monday) and let me know about the result? 

P.S. One more thing which I've missed with my last answer - set RadGridView.GroupRenderMode property to "Flat".

Regards,
Nedyalko Nikolov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Igor
Top achievements
Rank 2
answered on 19 Dec 2012, 09:15 AM
Nedyalko, thanks!
I will review my project with the latest changes.


>> with your application (and with assemblies attached) there is a small memory increase, which according to me is a minimal and should not trouble you

in production i am using more advanced data structures and having different results with memory (larger than in the example).
anyways, i will take a look at the proposed solution and will let you know the results. thank you for your time!
0
Igor
Top achievements
Rank 2
answered on 24 Dec 2012, 06:19 PM
Thank you!

Your suggestion with internal build and with RenderGroupMode = "Flat" works for me!
I dont see any high memory consumption so far.
0
Mark
Top achievements
Rank 1
answered on 16 Jan 2013, 09:54 PM
I want to use RenderGroupMode = "Flat" in my RadGridView style (so I can ensure that it is used everywhere)

When I add the line:
   <Setter Property="RenderGroupMode" Value="Flat" />
to my RadGridView style definition:
- Visual Studio 2012 builds it with no complaints, but
- When I run it, I get an XamlParseException on that line

Help?
0
Igor
Top achievements
Rank 2
answered on 16 Jan 2013, 09:57 PM
Mark, please provide more code of your style set.
What is the message that XamlParseException contains?
0
Mark
Top achievements
Rank 1
answered on 17 Jan 2013, 02:54 PM
Here is the style I am using :
<ResourceDictionary xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
                                xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
                                xmlns:telerik=http://schemas.telerik.com/2008/xaml/presentation

<Style x:Key="GridViewStyle TargetType="telerik:RadGridView">
  <Setter Property="CanUserSelect" Value="True" />
  <Setter Property="GroupRenderMode" Value="Flat" />
</Style>
</ResourceDictionary>

Note: I even used Visual Studio 2012 code completion for both "GroupRenderMode" and "Flat"

In the UI XAML file I set the style of RadGridView as follows:
   <telerik:RadGridView Style="{StaticResource GridViewStyle}" ...

At runtime the XamlParseException is on the line with GroupRenderMode with the following information:
  - "Set property 'System.Windows.Setter.Property' threw an exception
  - Inner Exception "Value cannot be null Parameter: property" 
  - The stack trace indicates: " at System.Windows.Markup.WpfXamlLoader.Load(...

Note: If I include the  GroupRenderMode="Flat"  directly in the XAML for a RadGridView, for example:
   <telerik:RadGridView Style="{StaticResource GridViewStyle}"  GroupRenderMode="Flat"  ...
the code runs without complaint.

Thank you for your help
0
Rossen Hristov
Telerik team
answered on 17 Jan 2013, 03:15 PM
Hi,

Can you please try with our Latest Internal Build version. I have attached a test project.

Greetings,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Igor
Top achievements
Rank 2
answered on 17 Jan 2013, 03:22 PM
i accept that the code:

<Window x:Class="RadControlsWpfApp1.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
 
    <Window.Resources>
        <Style TargetType="telerik:RadGridView">
            <Setter Property="GroupRenderMode" Value="Flat" />
        </Style>
    </Window.Resources>
 
    <Grid>
        <telerik:RadGridView x:Name="myGrid" />
    </Grid>
</Window>

will throw exception.

Latest internal build version works well without the exception!
Thanks Rossen!
0
Mark
Top achievements
Rank 1
answered on 17 Jan 2013, 08:33 PM
Great. Thank you for checking that. I am not sure we can use the internal build for our project, but at least I know that the problem will be fixed in the next release.

Thank you for your help
Tags
GridView
Asked by
Pat
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Pat
Top achievements
Rank 1
Betsy
Top achievements
Rank 1
Victor
Top achievements
Rank 1
Rossen Hristov
Telerik team
Igor
Top achievements
Rank 2
Nedyalko Nikolov
Telerik team
Mark
Top achievements
Rank 1
Share this question
or