We use RadChart (Q3 2010) that is being repeatedly bound to a list of data. We are seeing a memory leak in cases where there is a larger amount of data and the automatic aggregation of RadChart takes place. Is that a known issue?
Thank you.
Petr
14 Answers, 1 is accepted
During the past iterations we were able to spot some memory issues and fix them,
including the one caused by our sampling functionality. I have attached a small test application that uses the latest binaries and doesn't reproduce this memory issue. You can get our latest binaries and test in your environment.
Hope this helps!
Yavor Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks and kind regards
Thanks and regards
About your first question, yes, you can change from using series mappings and itemsSource to unbound mode. By doing this you won't be able to use some of the advanced RadChart functionalities like sampling, grouping & aggregation, filtering and sorting. This can spare some objects related to the data layer, but on the UI layer everything will remain the same.
We have found a major unmanaged leak in SL4 and we have actually reported this bug to Microsoft 3-4 months ago but still there is no fix. You will see both managed and unmanaged memory leak in SL4. Unfortunately currently our hands are tied with respect to this problem and at this point we can only hope that eventually there will be SL4 release that contains these important fixes.
When you have removed the SeriesMappigns RadChart will create a chart series for every numeric field in the data source by mapping the numeric value to the DataPointMember.YValue field for each respective series. You can find more information in this topic in our help system. This automatic behavior doesn't recognize nested collections, so in your scenario it is recommended to add your series mappings manually like described in this topic in our help system.
Hope this information helps!
Yavor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We have tested RadChart for Silverlight against the latest drop of SL5 and this unmanaged memory leak is no longer observed. As currently there are no known issues, you can safely update to the latest drop of SL5 and test your scenario.
Regards,Yavor
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We are facing memory leak when sort descriptor is added to RadChart.
I downloaded this sample code posted by you and changed it slightly to show collection of Share prices on timer tick.
I have used the same solution files, binaries which you shared with the code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Collections.ObjectModel;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
DispatcherTimer timer = new DispatcherTimer();
timer.Tick += timer_Tick;
timer.Interval = TimeSpan.FromMilliseconds(500);
CreateData();
this.chart1.ItemsSource = data;
timer.Start();
}
ObservableCollection<
SharePrice
> data = new ObservableCollection<
SharePrice
>();
Random r = new Random();
private void CreateData()
{
for (int i = 0; i < 250; i++)
{
data.Add(new SharePrice(DateTime.Now, r.Next(0, 100)));
}
}
private void timer_Tick(object sender, EventArgs e)
{
data.RemoveAt(0);
data.Add(new SharePrice(DateTime.Now, r.Next(0, 100)));
}
}
public class SharePrice
{
public DateTime PriceOn { get; set; }
public double Price { get; set; }
public SharePrice(DateTime dt, Double price)
{
this.PriceOn = dt;
this.Price = price;
}
}
}
And then added sort descriptor in RadChart tag in XAML file that and now one can see memory leak.
<
UserControl
x:Class
=
"SilverlightApplication1.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:RadChart
Name
=
"chart1"
>
<
telerik:RadChart.SortDescriptors
>
<
telerik:ChartSortDescriptor
Member
=
"PriceOn"
SortDirection
=
"Ascending"
/>
</
telerik:RadChart.SortDescriptors
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
x:Name
=
"SeriesMapping1"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:LineSeriesDefinition
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:ItemMapping
FieldName
=
"PriceOn"
DataPointMember
=
"XValue"
/>
<
telerik:ItemMapping
FieldName
=
"Price"
DataPointMember
=
"YValue"
/>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
<
telerik:RadChart.DefaultView
>
<
telerik:ChartDefaultView
>
<
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartArea
EnableAnimations
=
"False"
/>
</
telerik:ChartDefaultView.ChartArea
>
</
telerik:ChartDefaultView
>
</
telerik:RadChart.DefaultView
>
</
telerik:RadChart
>
</
Grid
>
</
UserControl
>
We are pretty much sure about the memory leak as we have profiled this application with a professional profiling tool.
If you remove only the sort descriptor part, the memory leak will be eliminated.
In our project, we will need sort descriptor and hence need to leave with this memory leak.
Please provide us with a solution on this memory leak.
Thanks,
Shashikant
I can confirm that we were able to reproduce the problem and our developers are already working on it. I will write back when we have any news.
Best regards,
Ves
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Our developers were able to provide a partial fix which will be included in the next internal build, expected on Monday. The fix is partial, because it does not cover the case where the sort descriptors are added to RadChart's SortDescriptors collection. However, there will be no memory leak if SeriesMapping.SortDescriptors property is used. So, once it is out, please download the next LIB and move the sort descriptors to the series mapping.
Best regards,
Ves
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Can you please give me the link where this fix/update is available for download?
Thanks,
Shashikant
The weekly internal build is available in the Download section of your Telerik client account.
Regards,
Giuseppe
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We downloaded the latest weekly internal build from our client account. We observed that RadMaskedTextBox does not exist in the binaries and our source code makes extensive use of the same.We are in process of verifying the fix for memory leak in RadChart using SortDescriptors.Can you please look into this?
Thanks
Srinath Dayala
The RadMaskedTextBox control is removed from the toolbox as we want to encourage our customers to take advantage of the new MaskedInput suite of controls instead. However, other than that the control is still part of the RadControls for Silverlight and its class definitions are in the Telerik.Windows.Controls.Input assembly so I am not sure what you mean by "we observed that RadMaskedTextBox does not exist in the binaries". Can you please elaborate on that and also tell us which version of our libraries you have downloaded?
Kind regards,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We now used the Telerik.Windows.Controls.Input dll and the code is compiling.Thanks for the information.