Page 1 of 1

Fast report in thread

Posted: Thu Oct 20, 2011 11:42 am
by 10548580
Hello,

I'm working on an application where reports (fast reports) are generated in a thread. This all works fine, but when I put some (TeeCharts) charts in the reports, the memory usage keeps
on growing after every run of the thread. I've contatcted FastReports, and they say it's because Teecharts isn't thread safe. I'm not doing anything special, in the thread I load the report,
fill it with data, and then export it to pdf and free the report and thread. The application doesn't report any errors, and the reports look fine, it just the memory usage. Does anyone know
how to solve this, or is this solved in a newer version of TeeChart. I'm working on Delphi XE and use the standard TeeChart components.

Thankyou!

Michiel

Re: Fast report in thread

Posted: Fri Oct 21, 2011 9:28 am
by yeray
Hello Michiel,

TeeChart isn't thread safe, that right. But it only means that you have to be careful when manipulating a chart from different threads. For example, you should control manually (with semaphores or something) if you want the chart to be drawn in one thread and to add points to the same chart from another thread, to avoid interferences. But I don't think it should imply an increasing memory demand.

Could you please send us a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

Re: Fast report in thread

Posted: Fri Oct 21, 2011 10:34 am
by 10548580
Hello Yeray,

I've included an example project, the unit uReportThread.pas is where the action happens. One other thing I noticed,
is that the charts are shown in the pdf on windows 32 bit, but don't show when run on windows 7 64 bit, although
no errors are shown. I thought the thread safety should not be an issue, the threads don't manipulate each other.

I hope you can help me.

Thanks in advance!

Best regards,
Michiel van Ingen

Re: Fast report in thread

Posted: Mon Oct 24, 2011 12:52 pm
by yeray
Hello Michiel,

I've ran your application and could reproduce the problem but not consistently. Sometimes the memory demand grows and descends to the same value it had and sometimes not. Isn't it the same for you?
If you think the threads aren't related, maybe you could simplify the testing application and make problem reproducible more consistently.
Thanks in advance.