Q3 2010 Memory Leak?

7 posts, 0 answers
  1. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 12 Apr 2011 Link to this post

    I've read the threads on the RadComboBox memory leak stemming from the well known SL4 memory leak. Are there any known issues with leaks on the SL4 SP1 / Telerik 2010.3.1314.1040 RadComboBox?

    We experience leaks when using the control in a DataTemplate for a CellTemplate in a RadGridView. The data template is a static resource on the page and the items source is an observable collection that contains hundreds of business objects.

    Without going into too much more detail I was just wondering if this was a known issue. Thanks!

    -Adam
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 14 Apr 2011 Link to this post

    Hello Adam,

    We are not aware of new memory leaks in RadComboBox that appeared recently. We strongly recommend testing with the latest Silverlight runtime (GDR3) and if the problem persists, we will need a simple project that could be used to trace memory leak. After that we will do our best to provide a fix as soon as possible.

    Kind regards,
    Valeri Hristov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 14 Apr 2011 Link to this post

    I am using GDR3, I mistakenly called it SP1.

    I have a project that reproduces the issue. See the RadGridView below. Each time the user clicks to open a new drop down in the grid the private bytes jumps significantly (I have 584 strings in the Birds ObservableCollection). The bytes are never reclaimed. 

    <UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="MemoryLeakTest.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
     
    	<UserControl.Resources>
    		<ContentControl x:Key="BaseContent" />
    		<DataTemplate x:Key="BirdPicker">
    			<telerik:RadComboBox 
    				ItemsSource="{Binding Source={StaticResource BaseContent}, Path=DataContext.Birds}"
    				SelectedValue="{Binding Path=Bird}"
    			/>
    		</DataTemplate>
    	</UserControl.Resources>
    	<Grid>
    		<telerik:RadGridView ItemsSource="{Binding BizObjs}" AutoGenerateColumns="False">
    			<telerik:RadGridView.Columns>
    				<telerik:GridViewDataColumn CellTemplate="{StaticResource BirdPicker}" DataMemberBinding="{Binding Bird}" />
    			</telerik:RadGridView.Columns>
    		</telerik:RadGridView>
    	</Grid>
    </UserControl>

  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 19 Apr 2011 Link to this post

    Hi Adam,

    I noticed that you have a ContentControl as a static resource, that seems to provide data context in the BirdPicker data template. This is not typical usage and might be causing the leak. Unfortunately without a complete project for debugging, I cannot say what's the real cause for the problem.

    All the best,
    Valeri Hristov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 19 Apr 2011 Link to this post

    The static resource is a little trick we all learned to slow the leak inherent in the SL4 runtime. If you hadn't heard about it, read this for a laugh: http://forums.silverlight.net/forums/t/171739.aspx

    Anyway, that static resource work around has become second nature, and while I agree it is not "typical usage", it is legal and should not (to my understanding) place us in uncharted territory.

    My colleague is sending you a toy project to demonstrate the problem. The only way I can stem the leak is to employ the virtualizing feature of RadComboBox. 

    Thanks for taking a look.

    -Adam

  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 20 Apr 2011 Link to this post

    Hi Adam,

    I received an application from Neil, I guess he is your colleague. I CC-ed you in his support ticket.

    Regards,
    Valeri Hristov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 20 Apr 2011 Link to this post

    Thank you for pointing out our oversight - The cell template's lifespan (and everything inside it) will always be equal to the Grid's. We need to quit being lazy and start using cell edit templates.

    No Leak!!
Back to Top
DevCraft banner