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:
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) |