This is a migrated thread and some comments may be shown as answers.

Memory leak?

27 Answers 253 Views
Chart
This is a migrated thread and some comments may be shown as answers.
SteveL
Top achievements
Rank 2
SteveL asked on 12 Aug 2009, 08:54 PM
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


27 Answers, 1 is accepted

Sort by
0
Bastian
Top achievements
Rank 2
answered on 14 Aug 2009, 10:28 AM
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
0
Dwight
Telerik team
answered on 14 Aug 2009, 10:51 AM
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.
0
SteveL
Top achievements
Rank 2
answered on 14 Aug 2009, 10:58 AM
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.
0
Dwight
Telerik team
answered on 18 Aug 2009, 08:27 AM
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.
0
Bastian
Top achievements
Rank 2
answered on 18 Aug 2009, 08:36 AM
When will the next build arrive?
This week?
At the moment we can't us the chart control!

Bastian
0
Giuseppe
Telerik team
answered on 18 Aug 2009, 11:46 AM
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.
0
Yusuf
Top achievements
Rank 1
answered on 02 Sep 2009, 06:19 AM
  • 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
0
Dwight
Telerik team
answered on 03 Sep 2009, 01:51 PM
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.
0
James
Top achievements
Rank 1
answered on 14 Sep 2009, 05:14 PM
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

0
Riz
Top achievements
Rank 1
answered on 04 Oct 2009, 09:59 AM
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
0
Dwight
Telerik team
answered on 06 Oct 2009, 07:45 AM
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.
0
Riz
Top achievements
Rank 1
answered on 08 Oct 2009, 07:14 PM
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 
0
Dwight
Telerik team
answered on 14 Oct 2009, 07:02 AM
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.
0
Riz
Top achievements
Rank 1
answered on 14 Oct 2009, 07:11 AM
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 
0
Ves
Telerik team
answered on 20 Oct 2009, 12:13 PM
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.
0
Maxim
Top achievements
Rank 1
answered on 28 Oct 2009, 12:37 PM
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.
0
Ves
Telerik team
answered on 29 Oct 2009, 08:22 AM
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.
0
Maxim
Top achievements
Rank 1
answered on 11 Nov 2009, 12:11 PM
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
0
Riz
Top achievements
Rank 1
answered on 15 Nov 2009, 01:20 PM
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.

0
Ves
Telerik team
answered on 16 Nov 2009, 11:30 AM
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.
0
Riz
Top achievements
Rank 1
answered on 29 Nov 2009, 10:00 AM
Yes, its working in our case, however please let us know when the complete fix is expected.

thank you very much 


0
Vladimir Milev
Telerik team
answered on 01 Dec 2009, 12:03 PM
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.
0
Riz
Top achievements
Rank 1
answered on 04 Dec 2009, 10:12 AM
please share with us the release date of SP1

Best regards,
0
Vlad
Telerik team
answered on 04 Dec 2009, 10:18 AM
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.
0
Maxim
Top achievements
Rank 1
answered on 15 Jan 2010, 12:29 PM
Hello again.

Is there any new information about fixing this bug?
0
Vladimir Milev
Telerik team
answered on 20 Jan 2010, 08:38 AM
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.
0
Maxim
Top achievements
Rank 1
answered on 20 Jan 2010, 08:48 AM
Hello

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

Thank you, Vladimir.

Tags
Chart
Asked by
SteveL
Top achievements
Rank 2
Answers by
Bastian
Top achievements
Rank 2
Dwight
Telerik team
SteveL
Top achievements
Rank 2
Giuseppe
Telerik team
Yusuf
Top achievements
Rank 1
James
Top achievements
Rank 1
Riz
Top achievements
Rank 1
Ves
Telerik team
Maxim
Top achievements
Rank 1
Vladimir Milev
Telerik team
Vlad
Telerik team
Share this question
or