Page 1 of 1

RealTime Chart

Posted: Thu Jan 27, 2011 2:48 am
by 15656007
Hello,

I create a realtime chart with the TeeChart for .net. And I find the memory will be increased slowly when the real-time chart building. The memory will be increased 3M—5M in 24 hours. How could I solve this problem?

Re: RealTime Chart

Posted: Thu Jan 27, 2011 10:54 am
by 10050769
Hello Candy,

I recommend take a look in our Technical articles concretely in Real-time Charting. If it isn't sufficient please, send us your project, so we can reproduce your problem exactly here, and try to find a solution.

Thanks,

Re: RealTime Chart

Posted: Sun Jan 30, 2011 7:40 am
by 15656007
Hello,
The attachemt is my code which I used to built the Real-Time chart. Could you provide me some methods about how to improve the efficiency? Otherwise, I can't find the DrawAllPoints property of the tchart which mentioned in the Technical articles .Thanks!

Best Regards,
Candy

Re: RealTime Chart

Posted: Sun Jan 30, 2011 8:56 am
by 15656007
Hello,
I forgot to add the attachment in the last post. This is my code file.

Re: RealTime Chart

Posted: Mon Jan 31, 2011 11:18 am
by narcis
Hi Candy,
Candy wrote:Could you provide me some methods about how to improve the efficiency?
The easiest solution to reduce memory consumption is removing "unnecessary" points as shown in the DoScrollPoints method in the Real-time charting article. Otherwise data stays in memory. If no data is removed then memory consumption will increase. As far as I can see you are already doing that in UpdateLeftChart() method.
Candy wrote: Otherwise, I can't find the DrawAllPoints property of the tchart which mentioned in the Technical articles .
This property only exists for FastLine series.
Candy wrote:I forgot to add the attachment in the last post. This is my code file.
Thanks, it was useful to see the nature of your application. Please bear in mind that using FastLine series would increase your application performance, not memory consumption as data is stored in the same way for Line and FastLine series. Also, FastLine series has no Pointer property, I see you are using it in your code. If you need that we run some tests with your code please attach a simple example project we can run "as-is" to reproduce the problems here.

Thanks in advance.

Re: RealTime Chart

Posted: Sat Feb 12, 2011 8:42 am
by 15656007
Hi Narcís ,
Thanks for your reply. The attachment is my test application. I following your method to modify my code,but the memory of my computer also increase when I run it.
Is there any other things should I do? And I notice that the cpu using is come up to 50%. What should I do?

Re: RealTime Chart

Posted: Mon Feb 14, 2011 9:09 am
by 15656007
Hello,
The attachment is my other test application. The memory increase from 20M to 40M in 6min when the application running. How could I to optimize my code?

Re: RealTime Chart

Posted: Mon Feb 14, 2011 11:26 am
by 10050769
Hello Candy,

Could you send again the last project, because the project you have attached doesn't work?

Thanks,

Re: RealTime Chart

Posted: Tue Feb 15, 2011 1:24 am
by 15656007
Hi Sandra,
The attachment is the whole project.

Re: RealTime Chart

Posted: Wed Feb 16, 2011 9:17 am
by 10050769
Hello Candy,

I have tested your project for 15 hours and the memory oscillates from 35M to 40M, and doesn't increase exaggeratedly using last version of TeeChart.Net 2010.

Could you say us, which version of TeeChart are you using now?

Thanks,

Re: RealTime Chart

Posted: Thu Feb 17, 2011 1:21 am
by 15656007
Hi Sandra,
Thanks for your reply,I used the TeeChart.Net 2010 too.

Re: RealTime Chart

Posted: Thu Feb 17, 2011 6:55 am
by 15656007
Hello,
Beacause our applcation will run in a long time,so if the memory increased unending,it's not allowed. Is there any ways to prevent the memory increased?
Thanks!
Best Regards,
Candy

Re: RealTime Chart

Posted: Thu Feb 17, 2011 8:16 am
by narcis
Hi Candy,
I used the TeeChart.Net 2010 too.
Which is the exact TeeChart for .NET 2010 build you are using? Is it build 4.0.2011.02080, which is the latest release available? If not, can you please try using this build?
Beacause our applcation will run in a long time,so if the memory increased unending,it's not allowed. Is there any ways to prevent the memory increased?
The first and most important way to prevent the memory used by the application growing is removing data which is no longer used or visible. Otherwise TeeChart needs memory to store this data and you should expect memory consumption to increase. Having said that, if you are already removing unneeded data from your application and memory consumption is still growing in a uncontrolled manner it could be a memory leak in TeeChart. According to what Sandra wrote here that's not the case with your application, memory stays in the same memory usage range during the whole execution of the application. Is that what you experience at your end?

Thanks in advance.

Re: RealTime Chart

Posted: Mon Feb 21, 2011 7:31 am
by 15656007
Hello,
I want the memory usage doesn't increased when my application is running. Is there any method to implement it?
Thanks !

Re: RealTime Chart

Posted: Mon Feb 21, 2011 12:59 pm
by narcis
Hi Candy,

For us to be able to help you further on this issue could you please answer the question I made you in my previous reply?
I want the memory usage doesn't increased when my application is running. Is there any method to implement it?
If you get the same behavior as Sandra and I described here this is normal considering you are already removing points from your chart, which is the way to avoid memory usage increasing. Please notice that the .NET Framework doesn't free objects immediately, it's garbage collector who does that task. Therefore you may see memory consumption oscillations in your application. At this thread you'll find a more in deep discussion on garbage collector and TeeChart.

Thanks in advance.