Using FastMM in Full Debug Mode

Fast Memory Manager (FastMM) is a third-party memory manager for Delphi. It is a fast replacement memory manager for Embarcadero Delphi applications that scales well across multiple threads and CPU cores, is not prone to memory fragmentation, and supports shared memory without external .DLL files.

Latest version of FastMM:

A widely used prior version:

Starting with Delphi 2006, a limited version of FastMM was chosen as the default memory manager for Delphi. If you are using Delphi 2006 or later, a limited FastMM is already included as the default memory manager.

FastMM is not only a memory manager — it can also be used as a powerful tool to detect memory problems in your applications. It can detect memory leaks, memory corruption, re-used disposed pointers, and more.

To use these diagnostic features you must:

  • download the full version of FastMM and compile it with your application, and

  • configure the required settings in the FastMM4Options.inc file.

This document uses FastMM4 in examples because it is well-known in the Delphi community and has more versatile licensing options.

Related reading that may help you better understand memory issues:

  • Memory Management — https://unigui.com/doc/online_help/memory-management.htm

  • Importance of Proper Memory Management — https://unigui.com/doc/online_help/importance-of-memory-managemen.htm

  • Object Lifetime Management — https://unigui.com/doc/online_help/object-lifetime-management.htm

If your application crashes randomly or you see random access violations (AV) in the application log, these can be signs of memory issues. In that case, test your application with FastMM Full Debug Mode using the instructions in this guide. Even if no visible errors appear, it is recommended to test with FastMM before deploying to production.

Atualizado