MemoryLeak with RadPanelBar-ItemCollection

6 posts, 1 answers
  1. Lukas
    Lukas avatar
    42 posts
    Member since:
    Feb 2009

    Posted 28 May 2010 Link to this post

    Hi,

    I ran into a strange problem here:
    I have a RadPanelBar wich is populated with some selfwritten UserControls called "UserGrid". Its a rather complex controls showing TimeLine for a user for one day.
    I load about 20 of these controls for one day.

    If I switch to another day and want to load 20 other UserGrids I first clear the RadPanelBar.Items with RadPanelBar.Items.Clear().
    After this RadPanelBar.Items.Count is 0 of course, then I load the next Controls and eveythings looks fine.

    But I recognized, everytime i change the day and load 20 different UserGrids, the memory usage of the browser increases, and never decreases.
    So I hhok up windbg.exe to my Internet Explorer to see if there are any undeleted Referencec that could stop the Garbage Collector from collecting th old UserGrids.
    Its show that there is a EventHandler bound to every Instance of the UserControl "System.EventHandler`1[[Telerik.Windows.Controls.OrientationChangedEventArgs, Telerik.Windows.Controls.Navigation]]"

    This bound EventHandler keeps the GC from collecting  the object and memory usage raises.
    I search but could not find anything how to unbind this event.
    Is there a way to do so are any suggestions how I could dispose the RadPanel-ItemCollection properly?

    I get the data from a WCF Web Service, wich caused other leak problems, but I could fix these by destroying and reinitializing the WCFClient-object after each message call.

    thx

    btw, here's a heap dump of one instance of "UserGrid"-Object definitly no more in use by the code. "Grid_DP" is the name of my application:
    Statistics: 
          MT    Count    TotalSize Class Name 
    06cb5784      170        40800 Grid_DP.UserGrid 
    Total 170 objects 
    0:031> !gcroot 0cef53bc 
    Note: Roots found on stacks may be false positives. Run "!help gcroot" for 
    more info. 
    Scan Thread 8 OSTHread 1360 
    Scan Thread 21 OSTHread b78 
    Scan Thread 22 OSTHread bd8 
    Scan Thread 23 OSTHread 15e4 
    Scan Thread 24 OSTHread 166c 
    Scan Thread 25 OSTHread 17d4 
    Scan Thread 30 OSTHread 1160 
    DOMAIN(02B6D500):HANDLE(Pinned):66412f8:Root:  05394260(System.Object[])-> 
      043aadcc(Grid_DP.Page)-> 
      04478730(Telerik.Windows.Controls.RadPanelBar)-> 
      0d0344b4(System.EventHandler`1[[Telerik.Windows.Controls.OrientationChangedEventArgs, Telerik.Windows.Controls.Navigation]])-> 
      0d008f14(System.Object[])-> 
      0d034494(System.EventHandler`1[[Telerik.Windows.Controls.OrientationChangedEventArgs, Telerik.Windows.Controls.Navigation]])-> 
      0cfd4de8(Telerik.Windows.Controls.RadPanelBarItem)-> 
      0cfd7d60(System.Windows.Controls.ItemCollection)-> 
      0cfd80e4(System.Collections.Generic.Dictionary`2[[System.Windows.UIElement, System.Windows],[System.Object, mscorlib]])-> 
      0cfd8c0c(System.Collections.Generic.Dictionary`2+Entry[[System.Windows.UIElement, System.Windows],[System.Object, mscorlib]][])-> 
      0cef53bc(Grid_DP.UserGrid) 
  2. Lukas
    Lukas avatar
    42 posts
    Member since:
    Feb 2009

    Posted 28 May 2010 Link to this post

    btw if someone is interested in how to debug and lookup memory stack of a Silverlight application using windbg.exe, have a look at these blog entries:

    http://davybrion.com/blog/2009/08/finding-memory-leaks-in-silverlight-with-windbg/

    http://viswaug.wordpress.com/2009/07/13/hunting-down-memory-leaks-in-silverlight/



  3. DevCraft banner
  4. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 03 Jun 2010 Link to this post

    Hello Lukas,

    Sorry for the late reply and thank you for the exhaustive information. It really helped us locate the issue. We will try to fix it as soon as possible. You can expect the fix to be available with our Beta release which is scheduled for the middle of this month. I've also updated your Telerik points. Let me know if you have further questions or comments regarding this issue.

    Kind regards,
    Kiril Stanoev
    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.
  5. Lukas
    Lukas avatar
    42 posts
    Member since:
    Feb 2009

    Posted 07 Jun 2010 Link to this post

    Thanks for the answer!

    I thought I would go crazy on this issue, because I couldn't find my mistake.

    Glad I could help and looking forward to the beta relase.

    Lukas
  6. Lukas
    Lukas avatar
    42 posts
    Member since:
    Feb 2009

    Posted 11 Aug 2010 Link to this post

    Hi

    just wanted to ask if there is any progress on this issue?

    I just downloaded he latest build 00734RadControls_for_Silverlight_4_2010_2_0806_TRIAL.zip and compile the project using these assemblys.

    But unfortunately the problem still remains unchanged!
    Are you still investigating the issue? May I help by providing additional info?

  7. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 16 Aug 2010 Link to this post

    Hello Lukas,

    It appears that the bug was added and solved immediately, but my investigation found that it wasn't solved correctly, that's why I've opened it again. It should be ready for the one of coming Internal builds. You can find and track the issue in our pits system. (It is called PanelBar: Memory leak).
    Sorry for any inconvenience.

    Sincerely yours,
    Miro Miroslavov
    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