Memory leak?

28 posts, 0 answers
  1. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 12 Aug 2009 Link to this post

    I've just installed the latest Q2 SP1 controls, and I seem to have a problem with memory usage. My application binds the chart series to an observable collection, and adds a new item to the collection every few seconds. Each time a new item is added, the memory usage goes up by several megabytes! I've created a simple test case that demonstrates the problem:
    public partial class MainPage : UserControl 
        { 
            private ObservableCollection<TestData> testDataSource; 
            private Random random; 
            DispatcherTimer timer; 
     
            public MainPage() 
            { 
                InitializeComponent(); 
     
                random = new Random(); 
     
                testDataSource = new ObservableCollection<TestData>(); 
     
                testChart.DefaultView.ChartArea.AxisX.IsDateTime = true
                testChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "t"
                
                // turn off animations 
                testChart.DefaultView.ChartArea.EnableAnimations = false
     
                // create mapping of data to axes 
                SeriesMapping seriesMapping = new SeriesMapping(); 
                seriesMapping.SeriesDefinition = new LineSeriesDefinition(); 
                seriesMapping.SeriesDefinition.ShowItemLabels = false
                seriesMapping.SeriesDefinition.ShowItemToolTips = true
                (seriesMapping.SeriesDefinition as LineSeriesDefinition).ShowPointMarks = false
                seriesMapping.SeriesDefinition.ItemToolTipFormat = "F1"
                seriesMapping.LegendLabel = "Test data"
     
                ItemMapping itemMapping = new ItemMapping(); 
                itemMapping.DataPointMember = DataPointMember.XValue; 
                itemMapping.FieldName = "DT"
                seriesMapping.ItemMappings.Add(itemMapping); 
     
                ItemMapping itemMapping2 = new ItemMapping(); 
                itemMapping2.DataPointMember = DataPointMember.YValue; 
                itemMapping2.FieldName = "TestItem"
                seriesMapping.ItemMappings.Add(itemMapping2); 
     
                testChart.SeriesMappings.Add(seriesMapping); 
                testChart.ItemsSource = testDataSource; 
     
                timer = new DispatcherTimer(); 
                timer.Interval = TimeSpan.FromMilliseconds(5000); 
               
                timer.Tick += new EventHandler(timer_Tick); 
                timer.Start(); 
            } 
     
            private void timer_Tick(object sender, EventArgs e) 
            { 
                testDataSource.Add(new TestData { DT = DateTime.Now, TestItem = random.Next(10) }); 
            } 
        } 
     
        public class TestData 
        { 
     
            public DateTime DT { getset; } 
     
            public double TestItem 
            { 
                get { return _testitem; } 
                set 
                { 
                    _testitem = value; 
                    var handler = PropertyChanged; 
                    if (null != handler) 
                    { 
                        handler.Invoke(thisnew PropertyChangedEventArgs("TestItem")); 
                    } 
                } 
            } 
     
            private double _testitem; 
     
            public event PropertyChangedEventHandler PropertyChanged; 
        } 

    Am I doing something wrong, or is there a problem with the new controls? I don't think I had this with the previous version of the SL3 controls.

    Steve


  2. Bastian
    Bastian avatar
    3 posts
    Member since:
    Sep 2008

    Posted 14 Aug 2009 Link to this post

    Hi Steve,

    have you solve the problems with the memory usage?

    I have the same problems with the new Chart Controls for SL3.
    The memory is over 250Mb in IE7.
    I have the same Mappings and the same SeriesDefination like in your example.
    Only the chart control have problems with the performance. Grid works fine.

    Bastian
  3. DevCraft banner
  4. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 14 Aug 2009 Link to this post

    Hello Steve and Bastian,

    We confirm there is an issue with the RadChart. There is an issue with the theming mechanism, on which we are currently working. The next week's internal build will include the fix.

    Best,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 14 Aug 2009 Link to this post

    As it's an issue with the theming mechanism, is there a work around?

    Do internal builds include the source? I have to use controls built from the source.
  6. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 18 Aug 2009 Link to this post

    Hello Steve,

    There is no workaround for this issue.

    Usually, we do not provide the source code with internal builds, but we can provide it per your request.
    Please, open a support ticket (not forum post), with a request for the source code.

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Bastian
    Bastian avatar
    3 posts
    Member since:
    Sep 2008

    Posted 18 Aug 2009 Link to this post

    When will the next build arrive?
    This week?
    At the moment we can't us the chart control!

    Bastian
  8. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 18 Aug 2009 Link to this post

    Hi Bastian,

    The weekly internal build will be available on Friday.

    We are sorry for the temporary inconvenience.


    Kind regards,
    Manuel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Yusuf
    Yusuf avatar
    15 posts
    Member since:
    Jan 2009

    Posted 02 Sep 2009 Link to this post

    • Hi,

      Was the theming issue fixed in the recent internal builds. Because, In my silverlight 3 application I have two controls one with grid and another having grid and charts. Both following a simple Data Binding Pattern. Now, I found out using basic Task Manager that when I bound to the other view the memory usage is increasing like anything. The charts are not using the default layout and are rendering multiple line series. All the features like point marks, tool tips are disabled. The chart renders values of type double against dates. Here i am posting my findings for the two views:

      This tests are done on Build : RadControls_for_Silverlight_2009_2_821_trial
      Basic Grid Control Data Binding 
    • Records                Actual Usage                

      15000                    18MB                    

      18000                    25MB                                 

      27000                    50MB                  

      31500                    55MB                


      Chart + Grid Control Binding

      Records                Actual Usage

      3500                       92MB

      5500                       133MB             UI starts Not responding!!!

      8500                       219MB

      13000                    310MB             Charts stops Rendering!!!



      As, you can see there is some issue with the Chart Control, I tried downloading the latest internal Build: RadControls_for_Silverlight_2009_2_828_trial but then the memory profile in all the above cases increase by twice!!!

      Thanks & Regards,
      Yusuf Nazami
  10. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 03 Sep 2009 Link to this post

    Hi Yusuf,

    Please, keep the communication in one thread, so it is easier to follow.

    Kind regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. James
    James avatar
    47 posts
    Member since:
    Jun 2009

    Posted 14 Sep 2009 Link to this post

    just tested the latest build (2009.2.911) it fixed the problem of version 812 on which I got OutOfMemory exception on updating a line chart every seconds

    James

  12. Riz
    Riz avatar
    29 posts
    Member since:
    Apr 2009

    Posted 04 Oct 2009 Link to this post

    We are using Q2 2009 release. problem does not appear to be fix. Every time the chart is reloaded memory foot print increase. Please suggest a work around

    thank you very much
  13. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 06 Oct 2009 Link to this post

    Hi Joe,

    The Q2 Release is the one having the memory leak. Please, upgrade to the Q2 SP1 release (version 2009.2.911).

    Best,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  14. Riz
    Riz avatar
    29 posts
    Member since:
    Apr 2009

    Posted 08 Oct 2009 Link to this post

    We upgraded to 2009.2.1002.1030, still the problem of memory exists.

    I conducted a little quick test on http://demos.telerik.com/silverlight/#Chart/FirstLook. Click and hover ( for tool tip ) on monthly chart every time this activity is performed it increases nearly 5 MB to memory foot print. 

    Our problem is more serious we have created a dashboard using telerik components. Charts and other components are refreshed every 30 seconds, thus the memory used by the application is doubled and never released by the browser. So, if the application is left for much time memory raises beyond 1 GB. 

    Please advice on this serious memory issue. 

    thank you very much 
  15. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 14 Oct 2009 Link to this post

    Hi Joe,

    We will investigate the memory leak. Currently, I would suggest cleaning all the data. That should decrease the memory pressure at least partially.

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  16. Riz
    Riz avatar
    29 posts
    Member since:
    Apr 2009

    Posted 14 Oct 2009 Link to this post

    We are calling Clean() where ever its available but we cant find any Dispose implementation.

    Please suggest a concrete solution to the problem this is causing serious problems as this rapid memory leak makes the entire application not responding. 


    Thank you very much 
  17. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 20 Oct 2009 Link to this post

    Hello Joe,

    I am afraid we are not able to provide a reasonable workaround for the moment. Our developers are  working on the problem, the fix is scheduled for the official Q3 release, scheduled in the beginning of November.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  18. Maxim
    Maxim avatar
    10 posts
    Member since:
    May 2009

    Posted 28 Oct 2009 Link to this post

    Hello

    We are having same problem with memory leak.
    Is there any new information about fixing this bug and release date?

    The problem is that we need to quickly decide whethere to look for some other solutions or not.
    Thank you.
  19. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 29 Oct 2009 Link to this post

    Hello Maxim,

    RadControls for Silverlight Q3 2009 release will include the fix. The release is expected next week.

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  20. Maxim
    Maxim avatar
    10 posts
    Member since:
    May 2009

    Posted 11 Nov 2009 Link to this post

    Hello.

    We changed controls to Q3. But the problem does not appear to be fix.

    We created simple application. Peak Workset grows to 125Mb (from less then 100) after 10 minutes. Commit size - to 100(from about 68) MB. Can you tell us, maybe we did something wrong?

    We posted example application to support ticket 257799
  21. Riz
    Riz avatar
    29 posts
    Member since:
    Apr 2009

    Posted 15 Nov 2009 Link to this post

    I am sorry I was on vacation with limited access to email

    I have tested the new version and memory remains slight above 100 but it does not increase exponential.


    Best regards.

  22. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 16 Nov 2009 Link to this post

    Hello Joe, Maxim.

    I am afraid Maxim has provided a different scenario in which another leak is demonstrated. Our developers are working on it. Joe, I believe the control works fine in your scenario?

    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  23. Riz
    Riz avatar
    29 posts
    Member since:
    Apr 2009

    Posted 29 Nov 2009 Link to this post

    Yes, its working in our case, however please let us know when the complete fix is expected.

    thank you very much 


  24. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 01 Dec 2009 Link to this post

    Hi Joe,

    We have fixed all known managed memory leaks already. The fixes will be included in the SP1 build. We are also actively investigating an SL Runtime leak together with the silverlight team at Microsoft. I have no time frame on that unfortunately as not everything is under our control.

    Sincerely yours,
    Vladimir Milev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  25. Riz
    Riz avatar
    29 posts
    Member since:
    Apr 2009

    Posted 04 Dec 2009 Link to this post

    please share with us the release date of SP1

    Best regards,
  26. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Dec 2009 Link to this post

    Hi Joe,

    Our SP1 will be release early next week.

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  27. Maxim
    Maxim avatar
    10 posts
    Member since:
    May 2009

    Posted 15 Jan 2010 Link to this post

    Hello again.

    Is there any new information about fixing this bug?
  28. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 20 Jan 2010 Link to this post

    Hi Maxim,

    Actually yes. I've been in close communication with the MS Silverlight team and they have confirmed the leak indeed originates in the SL runtime. So far we are not aware of a work-around.

    The good news is that this is scheduled to be fixed for SL4, the bad news is that they will probably not bother with SL3.

    I realize this is not what both you and me were hoping to hear, but I am afraid runtime leaks are beyond the scope of what we can do.

    Yours Sincerely,
    Vladimir Milev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  29. Maxim
    Maxim avatar
    10 posts
    Member since:
    May 2009

    Posted 20 Jan 2010 Link to this post

    Hello

    Well, it looks like we have to wait SL4. And hope ...

    Thank you, Vladimir.

Back to Top
DevCraft banner