How do I turn on/off FastMM memory leak reporting under Delphi XE?

Z80 picture Z80 · May 20, 2011 · Viewed 11.8k times · Source

How do I turn on/off FastMM memory leak reporting under Delphi XE? Under Delphi 7, I had to modify the inc file. But I hear that Delphi XE has FastMM already integrated. How do I access FastMM settings?


I got this from Delphi Help:

Full source code for the Memory Manager (FastMM) is available on SourceForge.
With the full version of FastMM, you can run the memory manager in a special "debug" mode which is useful for detecting heap corruption and memory leaks. Additional features in the full version of FastMM:
Double free objects / interfaces
File logging and reports

For more information, please see the comments in the FastMM source code(FastMM4.pas and FastMM4Options.inc).

So it looks like I still have to install FastMM manually. But do i have to include 'FastMM4' in project's USES clause?

Answer

David Heffernan picture David Heffernan · May 20, 2011

You do it by assigning to the Boolean variable System.ReportMemoryLeaksOnShutdown.

This will allow you to control the single most important setting, the reporting of memory leaks. If you want more fine grained control of the FastMM settings then include FastMM in your project just as you did in Delphi 7.