Reporting memory leaks on shutdown with a console application

前端 未结 4 606
野的像风
野的像风 2021-01-11 21:56

I\'ve created a console application and set ReportMemoryLeaksOnShutdown := True.

I\'ve created a TStringList but did not free it.

When the program finishes

4条回答
  •  一向
    一向 (楼主)
    2021-01-11 22:19

    The easiest is to simply run the application in a previously opened command window.

    If you insist on seeing the memory leak report while running in the IDE, do as follows:

    • Locate the ShowMessage procedure in GetMem.inc (line 4856 in Delphi 10 Seattle)
    • Place a breakpoint on the end; of that procedure.

    Alternatively, as Sertac Akyuz commented, put a break point on the end. of the system unit.

    You can also redirect the memory leak report to a file. Download the full version of FastMM from

    https://sourceforge.net/projects/fastmm/

    or better, thanks to Arioch 'The, from here:

    https://github.com/pleriche/FastMM4

    and set the needed options in FastMM4Options.inc

提交回复
热议问题