问题描述
我在下面的帖子中注意到,您可以从 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:
下载完整版的 FastMM 库
将其作为第一个单元包含在您的项目中:
include it as the first unit in your project:
program YourProject;
uses
FastMM4, // <--
SysUtils,
Forms,
...
在 FastMM4Options.inc
在链接项目选项中将 Map file 设置为 Detailed(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 获取堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!