Memory leak while using aggregation?

15 posts, 0 answers
  1. Petr
    Petr avatar
    8 posts
    Member since:
    Aug 2010

    Posted 13 Sep 2011 Link to this post

    Hi,

    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
  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 16 Sep 2011 Link to this post

    Hello Petr,

    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!

    Greetings,
    Yavor Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Iñigo
    Iñigo avatar
    14 posts
    Member since:
    Oct 2010

    Posted 27 Sep 2011 Link to this post

    Hi, I have a similar problem, I have a bar chart with several data series and groups, I add DataPoints one by one to the series. Whenever I update the data, the memory usage increases about 10MB. Do you think you could make an example application like this one but using dataseries and adding datapoints instead of just setting an itemsource?
    Thanks and kind regards
  5. Iñigo
    Iñigo avatar
    14 posts
    Member since:
    Oct 2010

    Posted 28 Sep 2011 Link to this post

    Hi again, I have removed the seriesmappings and now I am just binding to my chart an observablecollection of observablecollections. The first time I load data into the inner observablecollections, the chart gets bound with the data (it looks odd since I have not defined any seriesmapping, but it's ok for testing), but when I modify the content of the inner observablecollections the chart does not react (it does not change the data, it does not fire the bounding event...). It only changes when I call the "rebind" method of the chart (then, memory usage increases)... ¿any idea why it does not react to the changes in the data without calling the "rebind" method?
    Thanks and regards
  6. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 30 Sep 2011 Link to this post

    Hi Iñigo,

    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!

    All the best,
    Yavor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Gregory
    Gregory avatar
    10 posts
    Member since:
    Aug 2010

    Posted 27 Oct 2011 Link to this post

    Can anyone suggest any workaround at all for this issue? It is holding up the release of one of our products.
  8. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 01 Nov 2011 Link to this post

    Hi Gregory,

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

  9. Shashikant
    Shashikant avatar
    2 posts
    Member since:
    Dec 2011

    Posted 01 Dec 2011 Link to this post

    Hi Yavor ,

    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"
        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
  10. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 05 Dec 2011 Link to this post

    Hi 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 >>

  11. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 07 Dec 2011 Link to this post

    Hi Shashikant,

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

  12. Shashikant
    Shashikant avatar
    2 posts
    Member since:
    Dec 2011

    Posted 27 Dec 2011 Link to this post

    Thanks Ves,

    Can you please give me the link where this fix/update is available for download?

    Thanks,
    Shashikant
  13. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 28 Dec 2011 Link to this post

    Hi 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 >>

  14. Srinath
    Srinath avatar
    2 posts
    Member since:
    Jan 2012

    Posted 20 Jan 2012 Link to this post

    Hello Telerik Team,

    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
  15. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Jan 2012 Link to this post

    Hi Srinath,

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

  16. Srinath
    Srinath avatar
    2 posts
    Member since:
    Jan 2012

    Posted 24 Jan 2012 Link to this post

    Thanks Tina Stancheva for your reply.
    We now used the Telerik.Windows.Controls.Input dll and the code is compiling.Thanks for the information.
Back to Top
DevCraft banner