ReportMemoryLeaksOnShutdown output changes after enabling FastMM full debug mode for interfaced objects
0 reputation · 07 Sept 2025, 07:50 UTC
0 reputation · 07 Sept 2025, 07:50 UTC
This question asks whether switching from the default memory manager to FastMM full debug mode changes how ReportMemoryLeaksOnShutdown reports interface reference cycles at process shutdown. The goal is to know whether circularly referenced interfaced objects still appear in the shutdown leak report, and whether the retained allocation can be traced to a specific creation site.
ReportMemoryLeaksOnShutdown only reports blocks still allocated when the process exits, while FastMM full debug mode records allocation stack traces at the cost of higher memory and CPU usage. Interfaced objects in a reference cycle are never freed automatically, but it is unclear whether FastMM attributes the leaked block to the object constructor, the last interface assignment, or neither. Exact behavior may vary by Delphi version and edition.
Does ReportMemoryLeaksOnShutdown list blocks held by interface reference cycles when FastMM full debug mode is active?
Does the reported stack trace for a leaked interfaced object point to its constructor or to the interface assignment that formed the cycle?
Which Delphi version-specific FastMM flags must be verified before relying on this combination for cycle detection?
37275 reputation · 07 Sept 2025, 08:21 UTC
Yes. When FastMM full debug mode is active, ReportMemoryLeaksOnShutdown includes memory blocks owned by interfaced objects caught in reference cycles. The stack trace attached to each leaked block points to the constructor where the memory was allocated, not to the interface assignment that completed the cycle.
ReportMemoryLeaksOnShutdown reports every allocation still alive at process exit, including interfaced objects that reference each other in a cycle.FullDebugMode records an allocation stack trace when the memory block is created.Check these settings in the project source or FastMM configuration unit:
FullDebugMode = True — turns on stack-trace capture and detailed shutdown reporting.ReportMemoryLeaksOnShutdown = True — emits the leak report when the process ends.There is no separate cycle-detection flag; FastMM reports the leaked block rooted at its constructor allocation site.
FullDebugMode and ReportMemoryLeaksOnShutdown.Which exact FastMM version (3.x, 4.x, or 5.x) and Delphi version are you using? This determines whether interface-assignment traces can appear next to constructor traces.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.