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

Disposing user control and grid view content

4 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michele
Top achievements
Rank 2
Michele asked on 18 Feb 2010, 08:25 AM
Hello,
I wrote a SL application that loads huge data from WCF and display it in a gridview... keeping things simple I've got a main menu with 3 items (0 parameters,1 parameters, 2 parameters) and it shows up some data based on some criteria... On the click of a menu item I do a

gvContent.Items.Clear()

but if the user has just loaded the data from another menu item's content, IE/FFox won't free the ~150MB of ram allocated for the gridview.... need I to implement an IDisposable inside the gvContent's usercontrol? how I remove the items of the Gridview?

Thanks in advance

p.s. another question.... when I detach an event doing:

  m_clientUtility.GetStoreProcedureFromTipoCompleted -new EventHandler<GetStoreProcedureFromTipoCompletedEventArgs>(m_clientUtility_GetStoreProcedureFromTipoCompleted); 
            m_clientUtility.ExecuteStoreProcedureCompleted -new EventHandler<ExecuteStoreProcedureCompletedEventArgs>(m_clientUtility_ExecuteStoreProcedureCompleted); 

what happens to the 2 EventHandler created? when are they disposed ??(I've always asked myself)
Thanks
Paolo

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 22 Feb 2010, 04:43 PM
Hello Paolo,

Regarding your first question . In general you will not need to do anything additional in order to free memory ( such as implementing IDisposable) . As usually the framework will keep an object in memory as long as there is a reference to it.

So the next question would be - does RadGridView keep reference to the previous items or something else prevents the GC to flush the memory.

This can easily be checked - e.g.  try a regular  List box instead of  the RadGridView . If the problem disappears this would mean that RadGridView is to blame for the memory leak.
In such case please let us know and we will address this immediately.

Regarding your second question :

Event handler is delegate  - in other words just something that points to  another object's method.

The important thing which happens when you use " -=" to detach an event handler is that you break the reference between the two objects - the one raising the event and the one listening for the event.

Finally when an object remains unreferenced by other objects  it can get  collected by the GC.

Anyway, again if you  suspect any memory-related problems in your application are caused
by RadGridView or other controls from our suite - please let us know. ( with some details how to reproduce if possible ) .   Such issues are always addressed with high priority.

Regards,
Pavel Pavlov
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
Michele
Top achievements
Rank 2
answered on 23 Feb 2010, 10:03 AM
Hello Pavel,
I've checked.... I got the same problem with the ListBox... it's really strange...when I load the UC dinamically it tooks 4mb (not loading any telerik component) then cleaning everything I free 500kb...
0
Michele
Top achievements
Rank 2
answered on 23 Feb 2010, 11:05 AM
Hello Pavel,
sorry to disturb  you again... I thinks I've found something usefull.. I've found a post about finding memory leak by a colleage of yours... I've used windbg and after having done the switch between the usecontrol and cleared it I figured this :

I've done a !dumpheap -stat -Type Telerik and omitting the small ones... I got

0ac18cb4        7          336 System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[Telerik.Windows.Controls.Animation.RadAnimation, Telerik.Windows.Controls]]
0ba51a38        1          344 Telerik.Windows.Controls.RadGridView
0ac15a90       22          352 Telerik.Windows.ClassHandlersStore
0ac15694       23          368 Telerik.Windows.RoutedEventHandlerInfoList
0b53d08c        3          420 Telerik.Windows.RouteItem[]
0ac19920        7          420 System.Collections.Generic.Dictionary`2+Entry[[System.String, mscorlib],[Telerik.Windows.Controls.Animation.RadAnimation, Telerik.Windows.Controls]][]
0ac1745c       20          480 System.Collections.Generic.List`1[[Telerik.Windows.RoutedEventHandlerInfo, Telerik.Windows.Controls]]
0ac12690        4          496 Telerik.Windows.Controls.RadMenuItem
0ac1d4dc        1          604 System.Collections.Generic.Dictionary`2+Entry[[Telerik.Windows.DependencyObjectType, Telerik.Windows.Controls],[System.Object, mscorlib]][]
0ac187dc        1          604 System.Collections.Generic.Dictionary`2+Entry[[System.Windows.DependencyProperty, System.Windows],[Telerik.Windows.CoerceValueCallback, Telerik.Windows.Controls]][]
0ac1a238       41          656 Telerik.Windows.Controls.Office_BlackTheme
0ac13fc8       29          696 System.Collections.Generic.List`1[[Telerik.Windows.RoutedEvent, Telerik.Windows.Controls]]
0ac15f44       69          828 Telerik.Windows.DependencyPropertyKey
0ac153f4       34         1088 Telerik.Windows.CoerceValueCallback
0ac13b54       56         1120 Telerik.Windows.DependencyObjectType
0ac15c60       44         1352 Telerik.Windows.RoutedEventHandlerInfo[]
0ac14a5c        1         1436 System.Collections.Generic.Dictionary`2+Entry[[System.Type, mscorlib],[Telerik.Windows.DependencyObjectType, Telerik.Windows.Controls]][]
0ac15828       22         1812 Telerik.Windows.ClassHandlers[]
0ac132e8      115         3220 Telerik.Windows.RoutedEvent
0ac1559c      530        10600 Telerik.Windows.PropertyMetadata+<>c__DisplayClass1

I've done a !dumpheap -MT 0ac1559c     
and got :

0:031> !dumpheap -MT 0ac1559c 
 Address       MT     Size 
076f70a8 0ac1559c       20      
076f7590 0ac1559c       20      
076f7658 0ac1559c       20      
076f76dc 0ac1559c       20      
076f7760 0ac1559c       20      
076f77f8 0ac1559c       20      
076f787c 0ac1559c       20      
076f7900 0ac1559c       20      
076f7984 0ac1559c       20      
076f7afc 0ac1559c       20      
076f7d5c 0ac1559c       20      
076f7e74 0ac1559c       20      
076f7f10 0ac1559c       20      
076f7fac 0ac1559c       20      
076f852c 0ac1559c       20      
076f8608 0ac1559c       20      
076f873c 0ac1559c       20      
076f8b54 0ac1559c       20      
076f9688 0ac1559c       20      
076f976c 0ac1559c       20      
076f97f0 0ac1559c       20      
076f9904 0ac1559c       20      
076fe478 0ac1559c       20      
076fe568 0ac1559c       20      
076fe5fc 0ac1559c       20      
076fe690 0ac1559c       20      
076fe79c 0ac1559c       20      
076feabc 0ac1559c       20      
076ff018 0ac1559c       20      
076ff0b8 0ac1559c       20      
077025ec 0ac1559c       20      
07702970 0ac1559c       20      
07702aa4 0ac1559c       20      
07702bcc 0ac1559c       20      
07703830 0ac1559c       20      
077038f0 0ac1559c       20      
0770399c 0ac1559c       20      
07703abc 0ac1559c       20      
0770691c 0ac1559c       20      
07706a10 0ac1559c       20      
07706b70 0ac1559c       20      
077074c0 0ac1559c       20      
07707550 0ac1559c       20      
07707610 0ac1559c       20      
07707694 0ac1559c       20      
07707718 0ac1559c       20      
077077a8 0ac1559c       20      
07707888 0ac1559c       20      
07707918 0ac1559c       20      
0770799c 0ac1559c       20      
07707a2c 0ac1559c       20      
07707ab0 0ac1559c       20      
07707b50 0ac1559c       20      
07707bc0 0ac1559c       20      
077080b0 0ac1559c       20      
07708134 0ac1559c       20      
077081b8 0ac1559c       20      
07709b10 0ac1559c       20      
07709bc4 0ac1559c       20      
07709c54 0ac1559c       20      
07709ce4 0ac1559c       20      
07709d68 0ac1559c       20      
07709dec 0ac1559c       20      
0770a06c 0ac1559c       20      
0770a114 0ac1559c       20      
0770a1b0 0ac1559c       20      
0770bc4c 0ac1559c       20      
0770bd50 0ac1559c       20      
0770be60 0ac1559c       20      
0770bef8 0ac1559c       20      
0770bffc 0ac1559c       20      
0770c090 0ac1559c       20      
0770c114 0ac1559c       20      
0770c188 0ac1559c       20      
0770c2f8 0ac1559c       20      
0770c684 0ac1559c       20      
0770c714 0ac1559c       20      
0770c798 0ac1559c       20      
0770c834 0ac1559c       20      
0770c8d0 0ac1559c       20      
0770c96c 0ac1559c       20      
0770d538 0ac1559c       20      
0770d668 0ac1559c       20      
0770e050 0ac1559c       20      
0770e104 0ac1559c       20      
0770e298 0ac1559c       20      
0770e314 0ac1559c       20      
0770fca4 0ac1559c       20      
077113c4 0ac1559c       20      
07711498 0ac1559c       20      
0771151c 0ac1559c       20      
077115d8 0ac1559c       20      
07711720 0ac1559c       20      
077119a8 0ac1559c       20      
07711a2c 0ac1559c       20      
07711acc 0ac1559c       20      
07711bac 0ac1559c       20      
07711c94 0ac1559c       20      
07711d04 0ac1559c       20      
07711d74 0ac1559c       20      
07711e70 0ac1559c       20      
07711f00 0ac1559c       20      
07711f90 0ac1559c       20      
07712020 0ac1559c       20      
07712398 0ac1559c       20      
07712460 0ac1559c       20      
077124d0 0ac1559c       20      
07712584 0ac1559c       20      
07712668 0ac1559c       20      
07712700 0ac1559c       20      
07713894 0ac1559c       20      
0771396c 0ac1559c       20      
077139fc 0ac1559c       20      
07713a80 0ac1559c       20      
07713afc 0ac1559c       20      
07713b8c 0ac1559c       20      
07713c50 0ac1559c       20      
07713cd4 0ac1559c       20      
07713ed0 0ac1559c       20      
07713f60 0ac1559c       20      
07713fe4 0ac1559c       20      
07714068 0ac1559c       20      
077140ec 0ac1559c       20      
0771417c 0ac1559c       20      
07714238 0ac1559c       20      
077142bc 0ac1559c       20      
07714754 0ac1559c       20      
077147f4 0ac1559c       20      
07714878 0ac1559c       20      
077148ec 0ac1559c       20      
07714b70 0ac1559c       20      
0771841c 0ac1559c       20      
077184dc 0ac1559c       20      
07718580 0ac1559c       20      
07718610 0ac1559c       20      
07718724 0ac1559c       20      
07718794 0ac1559c       20      
0771aaa4 0ac1559c       20      
0771b4a8 0ac1559c       20      
0771bde4 0ac1559c       20      
0771be68 0ac1559c       20      
0771bf4c 0ac1559c       20      
0771bfe4 0ac1559c       20      
0771c074 0ac1559c       20      
0771c104 0ac1559c       20      
0771c174 0ac1559c       20      
0771c2a4 0ac1559c       20      
0771c344 0ac1559c       20      
0771c3b4 0ac1559c       20      
0771c534 0ac1559c       20      
0771c738 0ac1559c       20      
0771c84c 0ac1559c       20      
0771c8d0 0ac1559c       20      
0771c954 0ac1559c       20      
0771caa8 0ac1559c       20      
0771cbec 0ac1559c       20      
0771ccbc 0ac1559c       20      
0771cd4c 0ac1559c       20      
0771d740 0ac1559c       20      
0771e220 0ac1559c       20      
0771e2f0 0ac1559c       20      
0771e360 0ac1559c       20      
0771e4b8 0ac1559c       20      
0771e59c 0ac1559c       20      
0771e638 0ac1559c       20      
07720f6c 0ac1559c       20      
07722e68 0ac1559c       20      
07722f1c 0ac1559c       20      
07722fa0 0ac1559c       20      
07723010 0ac1559c       20      
07723538 0ac1559c       20      
077235ec 0ac1559c       20      
077239ec 0ac1559c       20      
07723a5c 0ac1559c       20      
07723acc 0ac1559c       20      
07724c68 0ac1559c       20      
07724d2c 0ac1559c       20      
07724dc0 0ac1559c       20      
07724e54 0ac1559c       20      
07724f90 0ac1559c       20      
07725fc8 0ac1559c       20      
07726114 0ac1559c       20      
0772626c 0ac1559c       20      
07726624 0ac1559c       20      
077266b8 0ac1559c       20      
07726cdc 0ac1559c       20      
07726d88 0ac1559c       20      
07726e00 0ac1559c       20      
07726e84 0ac1559c       20      
07727074 0ac1559c       20      
07727548 0ac1559c       20      
07727604 0ac1559c       20      
07727674 0ac1559c       20      
07727c60 0ac1559c       20      
07727d68 0ac1559c       20      
0774c304 0ac1559c       20      
0774c40c 0ac1559c       20      
0774c9a4 0ac1559c       20      
0774cafc 0ac1559c       20      
0774cbb0 0ac1559c       20      
0774dad0 0ac1559c       20      
0774dc80 0ac1559c       20      
0774e030 0ac1559c       20      
0774e154 0ac1559c       20      
0774e370 0ac1559c       20      
0774e4bc 0ac1559c       20      
0774e59c 0ac1559c       20      
0774e9ac 0ac1559c       20      
0774ea70 0ac1559c       20      
0774eb04 0ac1559c       20      
07752804 0ac1559c       20      
077539e8 0ac1559c       20      
07753bfc 0ac1559c       20      
07753c8c 0ac1559c       20      
07753d1c 0ac1559c       20      
07753dac 0ac1559c       20      
07753e30 0ac1559c       20      
077540c4 0ac1559c       20      
07754148 0ac1559c       20      
077541cc 0ac1559c       20      
07754dd0 0ac1559c       20      
07755390 0ac1559c       20      
07755588 0ac1559c       20      
0775560c 0ac1559c       20      
0775569c 0ac1559c       20      
0775572c 0ac1559c       20      
077557bc 0ac1559c       20      
0775584c 0ac1559c       20      
077558d0 0ac1559c       20      
07755954 0ac1559c       20      
077559d8 0ac1559c       20      
07755a68 0ac1559c       20      
07755af8 0ac1559c       20      
07755b88 0ac1559c       20      
07755c0c 0ac1559c       20      
07755c90 0ac1559c       20      
07755d14 0ac1559c       20      
07755ebc 0ac1559c       20      
0775623c 0ac1559c       20      
077562cc 0ac1559c       20      
0775633c 0ac1559c       20      
07758920 0ac1559c       20      
07758a08 0ac1559c       20      
07758a98 0ac1559c       20      
07758b3c 0ac1559c       20      
07758c70 0ac1559c       20      
07758d00 0ac1559c       20      
07758d70 0ac1559c       20      
0775a0c8 0ac1559c       20      
0775a17c 0ac1559c       20      
0775a20c 0ac1559c       20      
0775a280 0ac1559c       20      
0775a34c 0ac1559c       20      
0775a3dc 0ac1559c       20      
0775a4cc 0ac1559c       20      
0775a53c 0ac1559c       20      
0775a5c0 0ac1559c       20      
0775a644 0ac1559c       20      
0775a6d4 0ac1559c       20      
0775a780 0ac1559c       20      
0775a7e4 0ac1559c       20      
0775a868 0ac1559c       20      
0775abd4 0ac1559c       20      
0775ac44 0ac1559c       20      
0775e034 0ac1559c       20      
0775e108 0ac1559c       20      
0775e18c 0ac1559c       20      
0775e1fc 0ac1559c       20      
0775e26c 0ac1559c       20      
0775e2f0 0ac1559c       20      
0775e3b4 0ac1559c       20      
0775e444 0ac1559c       20      
0775e4c8 0ac1559c       20      
0775e52c 0ac1559c       20      
0775e5bc 0ac1559c       20      
0775e64c 0ac1559c       20      
0775e6c8 0ac1559c       20      
0775e74c 0ac1559c       20      
0775e7dc 0ac1559c       20      
0775e84c 0ac1559c       20      
0775fbb8 0ac1559c       20      
0775fc6c 0ac1559c       20      
0775fcfc 0ac1559c       20      
0775fd94 0ac1559c       20      
0775fe24 0ac1559c       20      
0775fea0 0ac1559c       20      
0775ff24 0ac1559c       20      
0775ffa8 0ac1559c       20      
07760198 0ac1559c       20      
0776021c 0ac1559c       20      
07760354 0ac1559c       20      
07764180 0ac1559c       20      
07764220 0ac1559c       20      
077642a4 0ac1559c       20      
07764338 0ac1559c       20      
0776439c 0ac1559c       20      
0776442c 0ac1559c       20      
077644b0 0ac1559c       20      
0776454c 0ac1559c       20      
077645bc 0ac1559c       20      
07764640 0ac1559c       20      
077646d0 0ac1559c       20      
07764740 0ac1559c       20      
077647b8 0ac1559c       20      
07764870 0ac1559c       20      
07764914 0ac1559c       20      
077649a4 0ac1559c       20      
07764a14 0ac1559c       20      
07764a84 0ac1559c       20      
07764b28 0ac1559c       20      
07764bdc 0ac1559c       20      
07764c60 0ac1559c       20      
07764ce4 0ac1559c       20      
07764d68 0ac1559c       20      
07764dec 0ac1559c       20      
07764e70 0ac1559c       20      
07764ef4 0ac1559c       20      
07764f78 0ac1559c       20      
07764ffc 0ac1559c       20      
07765060 0ac1559c       20      
077650e4 0ac1559c       20      
07765174 0ac1559c       20      
077651f8 0ac1559c       20      
077654f8 0ac1559c       20      
07765568 0ac1559c       20      
077655d8 0ac1559c       20      
0776563c 0ac1559c       20      
0776adac 0ac1559c       20      
0776af6c 0ac1559c       20      
0776b010 0ac1559c       20      
0776b0a0 0ac1559c       20      
0776b144 0ac1559c       20      
0776b1c8 0ac1559c       20      
0776b298 0ac1559c       20      
0776b348 0ac1559c       20      
0776b3cc 0ac1559c       20      
0776b51c 0ac1559c       20      
0776b5dc 0ac1559c       20      
0776b680 0ac1559c       20      
0776b724 0ac1559c       20      
0776b7c8 0ac1559c       20      
0776b86c 0ac1559c       20      
0776be7c 0ac1559c       20      
0776c620 0ac1559c       20      
0776c6b0 0ac1559c       20      
0776c740 0ac1559c       20      
0776c7d4 0ac1559c       20      
0776c864 0ac1559c       20      
0776c97c 0ac1559c       20      
0776ca30 0ac1559c       20      
0776cae4 0ac1559c       20      
0776cb74 0ac1559c       20      
0776cc04 0ac1559c       20      
0776cc98 0ac1559c       20      
0776cd54 0ac1559c       20      
0776cdc8 0ac1559c       20      
0776ce68 0ac1559c       20      
0776ceec 0ac1559c       20      
0776cf70 0ac1559c       20      
0776cff4 0ac1559c       20      
0776d078 0ac1559c       20      
0776d0fc 0ac1559c       20      
0776d18c 0ac1559c       20      
0776d21c 0ac1559c       20      
0776d2c0 0ac1559c       20      
0776d350 0ac1559c       20      
0776d3e0 0ac1559c       20      
0776d454 0ac1559c       20      
0776d538 0ac1559c       20      
0776d59c 0ac1559c       20      
0776d6e8 0ac1559c       20      
0776d7c8 0ac1559c       20      
0776d84c 0ac1559c       20      
0776d8d0 0ac1559c       20      
0776d954 0ac1559c       20      
0776da04 0ac1559c       20      
0776db28 0ac1559c       20      
0776dc50 0ac1559c       20      
0776dce0 0ac1559c       20      
0776dee4 0ac1559c       20      
0776dfb8 0ac1559c       20      
0776e03c 0ac1559c       20      
0776e0c0 0ac1559c       20      
0776e1d4 0ac1559c       20      
0776e244 0ac1559c       20      
0776e3a4 0ac1559c       20      
0776e458 0ac1559c       20      
0776e4fc 0ac1559c       20      
0776e56c 0ac1559c       20      
0776e7f4 0ac1559c       20      
0776e8b4 0ac1559c       20      
0776e938 0ac1559c       20      
0776e9f4 0ac1559c       20      
0776f314 0ac1559c       20      
0776f640 0ac1559c       20      
07779af4 0ac1559c       20      
07779b64 0ac1559c       20      
077879cc 0ac1559c       20      
07787a80 0ac1559c       20      
07787b40 0ac1559c       20      
07787bb8 0ac1559c       20      
07787c48 0ac1559c       20      
07787cac 0ac1559c       20      
07787d4c 0ac1559c       20      
07788bf8 0ac1559c       20      
07788d40 0ac1559c       20      
07788f98 0ac1559c       20      
07789064 0ac1559c       20      
077890e0 0ac1559c       20      
07789144 0ac1559c       20      
077891b8 0ac1559c       20      
07789248 0ac1559c       20      
077892d8 0ac1559c       20      
0778935c 0ac1559c       20      
0778952c 0ac1559c       20      
077895ac 0ac1559c       20      
0778f750 0ac1559c       20      
0778f804 0ac1559c       20      
0778f888 0ac1559c       20      
0778f90c 0ac1559c       20      
0778fa60 0ac1559c       20      
0778faf8 0ac1559c       20      
07795fb0 0ac1559c       20      
077960d4 0ac1559c       20      
07796158 0ac1559c       20      
07798b14 0ac1559c       20      
07798bc8 0ac1559c       20      
07798c4c 0ac1559c       20      
07798cbc 0ac1559c       20      
07798d50 0ac1559c       20      
07798dc0 0ac1559c       20      
07798e50 0ac1559c       20      
07798ee0 0ac1559c       20      
077990d0 0ac1559c       20      
07799144 0ac1559c       20      
077991b8 0ac1559c       20      
0779922c 0ac1559c       20      
077992a0 0ac1559c       20      
07799330 0ac1559c       20      
07799410 0ac1559c       20      
077994b4 0ac1559c       20      
0779f184 0ac1559c       20      
0779f244 0ac1559c       20      
0779f3c8 0ac1559c       20      
0779f458 0ac1559c       20      
0779f694 0ac1559c       20      
0779f79c 0ac1559c       20      
0779f818 0ac1559c       20      
077a724c 0ac1559c       20      
077b5f58 0ac1559c       20      
077b600c 0ac1559c       20      
077b6090 0ac1559c       20      
077b6104 0ac1559c       20      
077b6180 0ac1559c       20      
077b61fc 0ac1559c       20      
077b627c 0ac1559c       20      
077b62fc 0ac1559c       20      
077b637c 0ac1559c       20      
077b63fc 0ac1559c       20      
077b649c 0ac1559c       20      
077b651c 0ac1559c       20      
077b659c 0ac1559c       20      
077b663c 0ac1559c       20      
077b66bc 0ac1559c       20      
077b6758 0ac1559c       20      
077b67e8 0ac1559c       20      
077b684c 0ac1559c       20      
077b6bac 0ac1559c       20      
077b6cdc 0ac1559c       20      
077b74f0 0ac1559c       20      
077b75e4 0ac1559c       20      
077b7744 0ac1559c       20      
077b7810 0ac1559c       20      
077b788c 0ac1559c       20      
077b78f0 0ac1559c       20      
077b7a14 0ac1559c       20      
077b7a84 0ac1559c       20      
077b7b04 0ac1559c       20      
077b81ac 0ac1559c       20      
077b82a0 0ac1559c       20      
077b8704 0ac1559c       20      
077b9740 0ac1559c       20      
077b97d0 0ac1559c       20      
077b98bc 0ac1559c       20      
077b9958 0ac1559c       20      
077b99dc 0ac1559c       20      
077b9a74 0ac1559c       20      
077ba364 0ac1559c       20      
077ba488 0ac1559c       20      
077bae94 0ac1559c       20      
077baf34 0ac1559c       20      
077bafa4 0ac1559c       20      
077bb1d0 0ac1559c       20      
077bb320 0ac1559c       20      
077c4dec 0ac1559c       20      
077c5978 0ac1559c       20      
077c6fb4 0ac1559c       20      
077c70cc 0ac1559c       20      
077c7130 0ac1559c       20      
077c7e7c 0ac1559c       20      
077c7f10 0ac1559c       20      
077c7fb4 0ac1559c       20      
077c8064 0ac1559c       20      
077c8114 0ac1559c       20      
077c81f8 0ac1559c       20      
077c82b8 0ac1559c       20      
077c8328 0ac1559c       20      
077c8398 0ac1559c       20      
077c8408 0ac1559c       20      
077c8498 0ac1559c       20      
077c8508 0ac1559c       20      
077c8614 0ac1559c       20      
077c86a4 0ac1559c       20      
077c8734 0ac1559c       20      
077c8ac0 0ac1559c       20      
077c8b50 0ac1559c       20      
077c8bd4 0ac1559c       20      
077c8c58 0ac1559c       20      
077c8cdc 0ac1559c       20      
077c8d4c 0ac1559c       20      
077c8ddc 0ac1559c       20      
077c8e94 0ac1559c       20      
077c8f24 0ac1559c       20      
077c8ff0 0ac1559c       20      
077c90c4 0ac1559c       20      
077c9198 0ac1559c       20      
077c922c 0ac1559c       20      
077c92e8 0ac1559c       20      
077c9860 0ac1559c       20      
077c9978 0ac1559c       20     

doing a !gcroot

0:031> !gcroot 077c9978  
Note: Roots found on stacks may be false positives. Run "!help gcroot" for 
more info. 
Scan Thread 8 OSTHread 13b0 
Scan Thread 24 OSTHread 124c 
Scan Thread 25 OSTHread 12d4 
Scan Thread 28 OSTHread c94 
Scan Thread 29 OSTHread ea0 
DOMAIN(0598EDE8):HANDLE(Pinned):9b712f0:Root:  086e64a0(System.Object[])-> 
  077c99ac(System.Windows.CustomDependencyProperty)-> 
  077c998c(System.Windows.PropertyChangedCallback)-> 
  077c9978(Telerik.Windows.PropertyMetadata+<>c__DisplayClass1)-> 
DOMAIN(0598EDE8):HANDLE(Pinned):9b712f8:Root:  086e4260(System.Object[])-> 
  076e84a8(System.Collections.Generic.List`1[[System.Windows.DependencyProperty, System.Windows]])-> 
  0775c710(System.Object[])-> 
  077c99ac(System.Windows.CustomDependencyProperty)-> 
  077c998c(System.Windows.PropertyChangedCallback)-> 
  077c9978(Telerik.Windows.PropertyMetadata+<>c__DisplayClass1)-> 
 

As far as I've seen this can a memory leak.... can you confirm? Consider that I've not loaded any item from the GridView, just loaded it and then done a clear...

My XAML file is :

<IF:LayoutBase x:Class="IFWebLight.Utility.Dettagli.DataSingola" 
    xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"   
    xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:ms="clr-namespace:System.Windows.Controls;assembly=System.Windows" 
    xmlns:data="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"  
    xmlns:IF="clr-namespace:IFWebLight.Utility.Dettagli" 
    > 
    <Grid x:Name="LayoutRoot" Loaded="LayoutRoot_Loaded" SizeChanged="LayoutRoot_SizeChanged"
       <Grid.RowDefinitions> 
            <RowDefinition Height="25"></RowDefinition> 
            <RowDefinition ></RowDefinition
        </Grid.RowDefinitions> 
 
        <StackPanel Grid.Row="0" Orientation="Horizontal" x:Name="spMain"
            <TextBlock Text="Selezionare Vista" VerticalAlignment="Center" ></TextBlock
            <ComboBox x:Name="cbStore" Margin="5,0,0,0" DisplayMemberPath="Descrizione" MinWidth="120"></ComboBox> 
            <TextBlock  Text="Data Inizio" Width="70" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" ></TextBlock
            <telerikInput:RadDatePicker MinWidth="120" x:Name="dpDataInizio" IsTodayHighlighted="True" Height="22" IsEnabled="False" Margin="5,0,0,0"></telerikInput:RadDatePicker> 
 
            <Button x:Name="btnCarica" Margin="5,0,0,0" Content="Carica" Click="Carica_Click"></Button> 
            <Button x:Name="btnExport" Margin="5,0,0,0" Content="Export Xls" Click="btnExport_Click" IsEnabled="False" ></Button
        </StackPanel> 
        <Grid Grid.Row="1" Margin="0,5,0,0" HorizontalAlignment="Stretch" x:Name="gridContent" > 
             
            <telerikGridView:RadGridView x:Name="gvContent" AutoGenerateColumns="False" DataLoadMode="Asynchronous"
 
            </telerikGridView:RadGridView> 
            
        </Grid>  
     
        <telerik:RadProgressBar Grid.Row="1" x:Name="pb" Width="260" Height="30" Minimum="0" Maximum="1000" Margin="0,0,0,30" IsIndeterminate="True" Visibility="Collapsed" /> 
         
    </Grid> 
</IF:LayoutBase> 
 

Hope this helps... Thanks



0
Stefan Dobrev
Telerik team
answered on 01 Mar 2010, 07:10 AM
Hi Paolo,

Thanks for taking the time and profiling our memory usage. What you have found out are static references to dependency property metadata objects that RadGridView is using. This is definitely not a memory leak, because this is the way Silverlight works, it requires you to create static fields in order to have dependency properties.

All the best,
Stefan Dobrev
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
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Michele
Top achievements
Rank 2
Stefan Dobrev
Telerik team
Share this question
or