Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
UNIFORM-Agri
Newbie
Newbie
Posts: 7
Joined: Wed Sep 07, 2022 12:00 am

Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by UNIFORM-Agri » Wed Apr 12, 2023 12:36 pm

Hi all,

We experience Out Of Memory Exceptions when we print TChart (export to PDF) in our concurrent server environment.
I've managed to create an example application.

What I see is, when using ReportBuilder + Standard TeeChart delivered with Delphi, all seems to be OK.
When I install the TeeChart-pro version (rebuild TeeReCompile and RBTeePackageBuilder) and run the same application (rebuilded) I can reproduce 'Out Of Memory' quite frequent.


Precompiled binaries to try: https://we.tl/t-XAJMhrXBrM

To repoduce:
  • Open ReportBuilder_Test.exe (one of the 2 different compiled executables)
  • Hit button 'Start'
  • Exceptions will be logged, if none arise, try some times again.
I experience easier reproduction on my host-machine compared to run in a virtual environment.
Until now I didn't get the 'RBuilderTeeChartDelphi' example to break, but the 'RBuilderTeeChartPro' breaks quite easily.

Version info:
Delphi: 11.3.1
ReportBuilder: 22.01
TeeChart: 2023.38-beta

Sourcecode: in attachment (ReportBuilder.zip)
Callstack: in attachment (callstack.png)

Many thanks in advance!
Attachments
callstack.png
callstack.png (97.41 KiB) Viewed 17069 times
ReportBuilder.zip
(347.58 KiB) Downloaded 852 times

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by Marc » Thu Apr 13, 2023 3:55 pm

Hello,

Thank you for the problem description and sample application. We are able to run your project and reproduce the error you report. The issues have some complexity so it will likely take us some time to work through possible causes. We'll get back to this thread.

Regards,
Marc Meumann
Steema Support

UNIFORM-Agri
Newbie
Newbie
Posts: 7
Joined: Wed Sep 07, 2022 12:00 am

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by UNIFORM-Agri » Thu Apr 13, 2023 5:52 pm

Thank you Marc, please let me know the result.

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by Marc » Fri Apr 14, 2023 7:15 am

As a follow-up whilst we're looking at this. The problem doesn't seem to occur when tested with GDI (not GDI+).

If you'd like to test it, to see whether the output is at a level that is acceptable to you, the quickest way, if you're compiling with TeeChart sourcecode, is to set the default canvas here:

unit VCLTee.TeeProcs;

Code: Select all

initialization
  //TeeDefaultCanvas:={$IFDEF FMX}''{$ELSE}'TGDIPlusCanvas'{$ENDIF}; //commenting this line

  TeeDefaultCanvas:='';  //<- adding this line

...
There's a registry setting that controls that I think; I'll need to check, but the sourcecode mod will let you test it.

Regards,
Marc
Steema Support

UNIFORM-Agri
Newbie
Newbie
Posts: 7
Joined: Wed Sep 07, 2022 12:00 am

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by UNIFORM-Agri » Fri Apr 14, 2023 11:03 am

Hi Marc,

Yes I can confirm that switching to GDI don't give us errors (until now)!
With developer-eyes the generated images are still good enough :D

I had some troubles setting up to build with source, can you confirm the steps to do?
  • Add VCLTee to unit scope names
  • Add Source\VCL to library path (not source\ itself)
  • Add RBuilder\Source to library path (as we use RBuilder to print the charts)
Do I understand correctly that you're still looking for a final solution?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by Marc » Fri Apr 14, 2023 1:44 pm

Yes, we'll run some checks. GDI+ is known to suffer problems when many handles are requested via multiple threads but we are curious that it should have behaved differently with the TeeChart Standard version shipped with Delphi so we'll look for differences.

Regards,
Marc
Steema Support

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by Marc » Fri Apr 14, 2023 1:52 pm

Reviewing your steps:

Add VCLTee to unit scope names
Yes.

Add Source\VCL to library path (not source\ itself)
Yes, the Source\VCL folder. At project level: Project Options, Building, Delphi Compiler Search path.

Add RBuilder\Source to library path (as we use RBuilder to print the charts)
Yes, again, at project level, added this folder to the Search path too:
..program files ..\Embarcadero\Studio\20.0\RBuilder\TeeChart\Win32\TeePro900

UNIFORM-Agri
Newbie
Newbie
Posts: 7
Joined: Wed Sep 07, 2022 12:00 am

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by UNIFORM-Agri » Wed May 10, 2023 6:54 am

Hi,

I just see beta2 (2023.38.230508) is rolled out.
Should this version fix these GDI+ errors?

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

Re: Out Of Memory printing TeeChart (Delphi / ReportBuilder (Digital Metaphors)

Post by Yeray » Fri May 12, 2023 9:31 am

Hello,

I'm afraid there's still a problem with using GDIPlus in multiple threads.
Since metafile doesn't require GDIPlus, the workaround is to set GDI canvas.
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