Thank you for contacting us.
Apparently the leak is caused by RadElements left uncollected. RadPropertyValue holds the value of properties our theme mechanism applies and usually these property settings are the larger part of the memory a single RadElement takes. For this reason they appear first in the profiler. The amount of memory taken is different between different themes because themes might have different number of property settings defined.
Usually, RadElements get disposed recursively and you don't have to do this manually. However, there are several cases that might cause the leak:
1. If you subscribe to an event handler of living object, the subscriber cannot get released by the garbage collector until you have unsubscribed from the event. For example, if you subscribe to Form1.SizeChanged and the handler is a method of any of your custom elements, this custom element won't get released while the form lives as it needs to fire the event handler.
2. If you are using timers in any of your objects, you should stop and dispose them when the object is disposed. Timers are special objects that cannot be collected while active and their Tick handler will retain your object.
3. It might be the case that you are creating more objects than the garbage collector can collect. AppointmentFormatting is an event that fires quite often, not only when an AppointmentElement is created but also when something in the appointment changes. So you might just be creating to much objects. To avoid that you can try creating a custom AppointmentElement (a derived class), create a factory that implements the IAppointmentElementFactory interface to instantiate your custom appointments, then set the factory to the AppointmentElementFactory
property of RadScheduler.
I hope some of the suggestions will help. If you are still facing difficulties, please send me a sample code which demonstrates your scenario. This way I will be able to provide you with further suggestions.
TRY TELERIK'S NEWEST PRODUCT - APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>