如何从 FastMM 获取堆栈跟踪 [英] How to get a stack trace from FastMM

查看:29
本文介绍了如何从 FastMM 获取堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的帖子中注意到,您可以从 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:

如何使用 fastMM 追踪棘手的内存泄漏?

不过,我找不到有关如何在 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,
  ...

  • 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 获取堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆