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

MemoryLeak with RadPanelBar-ItemCollection

5 Answers 53 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Lukas
Top achievements
Rank 2
Lukas asked on 28 May 2010, 02:33 PM
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) 

5 Answers, 1 is accepted

Sort by
0
Lukas
Top achievements
Rank 2
answered on 28 May 2010, 02:37 PM
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/



0
Accepted
Kiril Stanoev
Telerik team
answered on 03 Jun 2010, 09:11 AM
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.
0
Lukas
Top achievements
Rank 2
answered on 07 Jun 2010, 08:15 AM
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
0
Lukas
Top achievements
Rank 2
answered on 11 Aug 2010, 12:51 PM
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?

0
Miro Miroslavov
Telerik team
answered on 16 Aug 2010, 01:00 PM
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
Tags
PanelBar
Asked by
Lukas
Top achievements
Rank 2
Answers by
Lukas
Top achievements
Rank 2
Kiril Stanoev
Telerik team
Miro Miroslavov
Telerik team
Share this question
or