RadComboBox creates a memory leak

12 posts, 0 answers
  1. Simon Störmer
    Simon Störmer avatar
    31 posts
    Member since:
    Oct 2012

    Posted 04 Jun 2010 Link to this post

    Hi,

    I think that the RadComboBox is causing a memory leak. I have a very simple test program: my root visual has a button and a content presenter (called Content). Once I hit the button, the following code is executed:

    content.Content = new RadComboBox();  

    Once I click the button I would assume that the old combobox which is then cut off form the visual tree would be garbage collected. But by constantly clicking the button the memory usage increases and even calls to GC.Collect() do not free a byte of memory.

    The GCRoot output for any of the comboboxes are as follows:

    DOMAIN(02D58638):HANDLE(Pinned):6b612f8:Root:  058b4260(System.Object[])->  
      048c8e9c(System.Collections.Generic.Dictionary`2[[System.IntPtr, mscorlib],[System.Object, mscorlib]])->  
      058bce70(System.Collections.Generic.Dictionary`2+Entry[[System.IntPtr, mscorlib],[System.Object, mscorlib]][])->  
      04bd6920(System.Windows.Controls.ContentControl)->  
      04bd7290(System.Windows.Controls.Grid)->  
      04bd72f4(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->  
      04bd7340(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->  
      04bd739c(System.Windows.Controls.ScrollViewer)->  
      04bd7808(System.Windows.Controls.ItemsPresenter)->  
      04bd7870(MS.Internal.CoreTypeEventHelper)->  
      04bd7f84(System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[MS.Internal.CoreTypeEventHelper+EventAndDelegate, System.Windows]])->  
      04bd7fd0(System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[MS.Internal.CoreTypeEventHelper+EventAndDelegate, System.Windows]][])->  
      04bd7f74(MS.Internal.CoreTypeEventHelper+EventAndDelegate)->  
      04bd7f3c(System.Windows.Input.KeyEventHandler)->  
      04bd4794(Telerik.Windows.Controls.RadComboBox)  
     

    Maybe I miss-interprete something here. If so, I would be glad to hear how to free the allocated memory.

    Thank you,

    Tobias Richling.
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 08 Jun 2010 Link to this post

    Hi Tobias Richling,

    If you are using Silverlight 4 then this is a problem with the framework.
    You can read more information here:
    http://forums.silverlight.net/forums/t/171739.aspx

    Microsoft is aware of it and is working on updated that will address it.

    All the best,
    Hristo
    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. Frank Wanicka
    Frank Wanicka avatar
    20 posts
    Member since:
    Jun 2010

    Posted 01 Sep 2010 Link to this post

    Microsoft released a "fixed" version today and I am still seeing this behavior with your ComboBox control. Please advise.
  5. Frank Wanicka
    Frank Wanicka avatar
    20 posts
    Member since:
    Jun 2010

    Posted 01 Sep 2010 Link to this post

    I have a simple screen with one combobox and one button. With your combobox, it does not garbage-collect. With the standard Silverlight combobox and a combobox from one of your competitors (the only other one I tried), it does garbage collect. This is with the new Silverlight build that came out today. Using WinDbg, I get the following:

    DOMAIN(0506CE28):HANDLE(Pinned):4d212f8:Root:  08e24260(System.Object[])->
      07e38ee0(System.Collections.Generic.Dictionary`2[[System.IntPtr, mscorlib],[System.Object, mscorlib]])->
      08f0d6b0(System.Collections.Generic.Dictionary`2+Entry[[System.IntPtr, mscorlib],[System.Object, mscorlib]][])->
      082795f8(System.Windows.Controls.Grid)->
      0827965c(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      082796a8(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      08279724(System.Windows.Controls.Border)->
      0827a8c8(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      0827a914(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      08279f7c(System.Windows.Controls.Grid)->
      08279fe0(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      0827a02c(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      0827a078(System.Windows.Controls.ScrollViewer)->
      0827a844(System.Windows.Controls.ItemsPresenter)->
      0827a8ac(MS.Internal.CoreTypeEventHelper)->
      0827b1fc(System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[MS.Internal.CoreTypeEventHelper+EventAndDelegate, System.Windows]])->
      0827b248(System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[MS.Internal.CoreTypeEventHelper+EventAndDelegate, System.Windows]][])->
      0827b1ec(MS.Internal.CoreTypeEventHelper+EventAndDelegate)->
      0827b1b4(System.Windows.Input.KeyEventHandler)->
      08221404(Telerik.Windows.Controls.RadComboBox)->
      0826b430(System.Windows.Controls.StackPanel)->
      0826b52c(System.Windows.Controls.Grid)->
      0826c754(System.Windows.Controls.Grid)->
      082756c0(System.Windows.Controls.ContentPresenter)->
      08275734(System.Windows.Controls.Border)->
      08275004(System.Windows.Controls.Grid)->
      08275334(System.Windows.Controls.Border)->
      08275430(System.Windows.Controls.Border)->
      0827552c(System.Windows.Controls.Grid)->
      08274338(System.Windows.Controls.Grid)->
      0821e640(Cliffs.PurchasingSystem.ImpersonateUser)

    It looks like something with a KeyHandler? Here's the XAML:

      <telerikInput:RadComboBox x:Name="UserNameComboBox"
                                              IsEditable="False"
                                              Width="200"
                                              Margin="8,1,1,1"
                                              Height="22"
                                              HorizontalAlignment="Left"
                                              DisplayMemberPath="DisplayName"
                                              SelectedValuePath="UserGUID"                                          
                                              VirtualizingStackPanel.VirtualizationMode="Standard">
                        <telerikInput:RadComboBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel />
                            </ItemsPanelTemplate>
                        </telerikInput:RadComboBox.ItemsPanel>
                    </telerikInput:RadComboBox>

  6. Le_Roy
    Le_Roy avatar
    31 posts
    Member since:
    Nov 2009

    Posted 02 Sep 2010 Link to this post

    Hi, Frank!
    Because Microsoft released updated Silverlight SDK, controls should be built against new SDK, to be "leak free" from known Silverlight bugs, which mentioned in MS KB.
    There can be other reasons for memory to leak. So, lets see, when updated controls will be released.
  7. Frank Wanicka
    Frank Wanicka avatar
    20 posts
    Member since:
    Jun 2010

    Posted 02 Sep 2010 Link to this post

    That is not necessarily the case according to Tim Heuer. He says, "you don't necessarily need to compile your apps using the new bits (it never hurts of course), but any user experiencing these issues would need the new runtime to have the fixed behavior.  This was not a developer-related fix, but more of a runtime fix."

    Do you have a timeline for when you will have new versions?

  8. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 07 Sep 2010 Link to this post

    Hi Everybody,

     Unfortunately the issue that caused the RadComboBox control to leak is not fixed in the latest version of Silverlight.

    Kind regards,
    Miroslav Nedyalkov
    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
  9. Frank Wanicka
    Frank Wanicka avatar
    20 posts
    Member since:
    Jun 2010

    Posted 07 Sep 2010 Link to this post

    Ok. Just so you know, this does not occur with the standard Silverlight combobox or the ComboBox from another third-party vendor I tried. I hope you can find a workaround soo, as we like your controls, and would rather not have to switch to another vendor.
  10. Sergey
    Sergey avatar
    22 posts
    Member since:
    Aug 2008

    Posted 07 Sep 2010 Link to this post

    Personally, I think this response gets us nowhere.  I know my customers do not care who caused the issue, all they care about is when it is going to be solved.  Regardless of whose problem it is, our customers and us are the ones that deal with it.  I think that Telerik must get with Microsoft and get a prompt resolution to this issue before all of: customer, software vendors, Telerik and Microsoft give Silverlight a bad name.

  11. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 08 Sep 2010 Link to this post

    I agree. Telerik must do something about this and come up with a date for a fix - we use their combobox on almost all of our usercontrols and it is preventing normal GC. Luckily it turned out that the treeview (which we also use a lot) doesn't leak anymore when we use resource based templates.
  12. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Sep 2010 Link to this post

    Hello guys,

    There are numerous memory leaks in Silverlight 4 that were not fixed with GDR1. We reported all issues we found to Microsoft and they confirmed them, but very few were actually fixed. Hopefuly there will be another Silverlight update that addresses those, but we do not have any information from Microsoft regarding the future Silverlight 4 updates.

    The reason RadComboBox and RadMenu leak memory is a bug in GDR1 that occurs when you have an element in a Popup, that is bound to a custom dependency property. For example, RadComboBox contains a Button in its dropdown Popup, that is bound to the ClearSelectionButtonVisibility/Content properties. We are working on a solution for this problem, I hope that we will be able to provide a fix by the end of this week. Unfortunately we were unable to find workarounds that do not involve changes in the control template, so if you have a custom theme, you will have to update it in order to prevent the control from leaking. Of course, we will provide detailed instructions how to update your themes.

    I hope this information helps.

    Best 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
  13. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Sep 2010 Link to this post

    I just found that Stefan provided very good explanation about the memory leak problems in Silverlight 4, if someone is interested, please check the following forum thread:
    http://www.telerik.com/community/forums/silverlight/general-discussions/silverlight-4-memory-leaks.aspx

    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
Back to Top
DevCraft banner