Fast report in thread

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Michiel
Newbie
Newbie
Posts: 2
Joined: Tue Mar 11, 2008 12:00 am

Fast report in thread

Post by Michiel » Thu Oct 20, 2011 11:42 am

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

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Fast report in thread

Post by Yeray » Fri Oct 21, 2011 9:28 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Michiel
Newbie
Newbie
Posts: 2
Joined: Tue Mar 11, 2008 12:00 am

Re: Fast report in thread

Post by Michiel » Fri Oct 21, 2011 10:34 am

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
Attachments
report.zip
(281.4 KiB) Downloaded 546 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Fast report in thread

Post by Yeray » Mon Oct 24, 2011 12:52 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply