This question is locked. New answers and comments are not allowed.
Hello,
I think I found a memory leak.
The source code for my program - XAML:<Grid x:Name="LayoutRoot" Background="White"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <telerikChart:RadChart Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" x:Name="radChart"> <telerikChart:RadChart.DefaultView> <telerikCharting:ChartDefaultView> <telerikCharting:ChartDefaultView.ChartArea> <telerikCharting:ChartArea LegendName="chartLegend"> <telerikCharting:ChartArea.DataSeries> <!-- Doughnut Chart --> <telerikCharting:DataSeries> <telerikCharting:DataSeries.Definition> <telerikCharting:DoughnutSeriesDefinition ItemLabelFormat="p"> </telerikCharting:DoughnutSeriesDefinition> </telerikCharting:DataSeries.Definition> <telerikCharting:DataPoint YValue="0.215208267" LegendLabel="Toyota"/> <telerikCharting:DataPoint YValue="0.192960612" LegendLabel="General Motors"/> <telerikCharting:DataPoint YValue="0.151830229" LegendLabel="Volkswagen"/> <telerikCharting:DataPoint YValue="0.125964366" LegendLabel="Ford"/> </telerikCharting:DataSeries> </telerikCharting:ChartArea.DataSeries> </telerikCharting:ChartArea> </telerikCharting:ChartDefaultView.ChartArea> </telerikCharting:ChartDefaultView> </telerikChart:RadChart.DefaultView> </telerikChart:RadChart> <telerik:RadRichTextBox Grid.Row="0" Grid.Column="1" Margin="10" x:Name="rRichTextBox1" IsReadOnly="True" /> <telerik:RadRichTextBox Grid.Row="1" Grid.Column="1" Margin="10" x:Name="rRichTextBox2" IsReadOnly="True" /> <telerik:RadRichTextBox Grid.Row="2" Grid.Column="1" Margin="10" x:Name="rRichTextBox3" IsReadOnly="True" /></Grid>And the code behind:
public MainPage(){ InitializeComponent(); radChart.DefaultView.ChartArea.ItemClick += ChartArea_ItemClick;}void ChartArea_ItemClick(object sender, Telerik.Windows.Controls.Charting.ChartItemClickEventArgs e){ HtmlFormatProvider html = new HtmlFormatProvider(); rRichTextBox1.Document = html.Import(AddText(e.DataPoint.LegendLabel, e.DataPoint.YValue.ToString())); rRichTextBox2.Document = html.Import(AddText(e.DataPoint.LegendLabel, e.DataPoint.YValue.ToString())); rRichTextBox3.Document = html.Import(AddText(e.DataPoint.LegendLabel, e.DataPoint.YValue.ToString()));}private string AddText(string item, string value){ StringBuilder builder = new StringBuilder(); builder.Append("<table>"); builder.Append("<tr>"); builder.Append("<td>"); builder.Append("<b>Item clicked:</b>"); builder.Append("</td>"); builder.Append("<td>"); builder.Append("<b>Value:</b>"); builder.Append("</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>"); builder.Append(item); builder.Append("</td>"); builder.Append("<td>"); builder.Append(value); builder.Append("</td>"); builder.Append("</tr>"); builder.Append("</table>"); builder.Append("<p>And some extra text: RadChart for Silverlight is the exact tool to transform various business scenarios into interactive, rich, animated charts that enable the end users to analyze complex data. Telerik Silverlight Chart is a 100% lookless control providing full support for Expression Blend. All 2D series, charts and axis elements can be dropped independently in Blend and styled individually. Furthermore the control offers several pre-defined skins, which will help you to deliver a consistent look and feel in your application.application best.</p>"); return builder.ToString();}Run this program and click chart control few times (memory usage will increase).
In this simple program memory usage stopped increasing after a while, but in my real application (where data is loaded from a database) – it never stops.
