Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Possible memory leak loading EMF file to TImage

I'm working with Delphi XE10 10.2.2 and RB 18.03 build 375, and am seeing something odd when working with EMFs. I have a single-page template with an Image (creatively named Image1). In Image1OnPrint, we pull a file name from a JITPipeline, and

Image1.Picture.LoadFromFile(fileName);

If the file is a bmp, memory usage after printing the page stays pretty flat. If the file is an emf, then the application process will jump by about 2.5 - 3.0 MB per print. The application starts out with about 100MB allocated, but I've gotten it up to a 1.5GB just by repeatedly printing these pages, so I don't know if there's an upper bound at which it will stop, but it's certainly higher than it should be.

I've tried
Image1.Picture.Graphic := nil;
in the ReportAfterPrint on the off chance it's got a handle it doesn't want to relinquish, but apparently that's not sufficient.

Are you aware of anything in updates since 18.03 that would address this?

Comments

  • Hi Stephen,

    This is not currently a known issue.

    How are you monitoring memory usage? Are you detecting an actual memory leak using a memory manager such as FastMM?

    In my quick testing with a simple Metafile and FastMM, I did not detect any memory leaks with the latest version of ReportBuilder. If you would like to create a simple example demonstrating the problem I can run here, please send it in .zip format to support@digital-metaphors.com and I will perform the same tests.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.