问题描述
我在以下帖子中注意到,您可以从FastMM中获取堆栈跟踪,以显示对象分配的内容:
I've noticed in the following post that you can get a stack trace out of FastMM to show what appears to be where an object was allocated:
我不能找到有关如何在Delphi 2009中启用此功能的任何信息。
I can't find any information on how to enable this in Delphi 2009, though.
我已将 ReportMemoryLeaksOnShutdown
设置为true,所以我获取基本报告,但如何获取堆栈跟踪报告?
I have set ReportMemoryLeaksOnShutdown
to true so I get the basic report, but how do I get the stack trace report?
推荐答案
FastMM的内部Delphi版本不支持堆栈跟踪。
The internal Delphi version of FastMM doesn't support stack traces.
如果要记录内存泄漏堆栈跟踪,您必须:
If you want to log the memory leak stack traces, you have to:
-
下载完整版的
将其作为第一单元包含在您的项目中:
include it as the first unit in your project:
program YourProject;
uses
FastMM4, // <--
SysUtils,
Forms,
...
在中启用
FullDebugMode
选项FastMM4Options.inc
enable the FullDebugMode
option in FastMM4Options.inc
将映射文件设置为详细在链接项目选项 FastMM_FullDebugMode.dll
处理 .map
文件)
set Map file to Detailed in the linking project options (the FastMM_FullDebugMode.dll
processes the .map
file)
在您的二进制(或Windows System32
)目录中添加 FastMM_FullDebugMode.dll
add the FastMM_FullDebugMode.dll
in your binary (or Windows System32
) directory
这篇关于如何从FastMM获取堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!