【问题标题】:FastMM/DXE2 only reporting when using debugger?FastMM/DXE2 仅在使用调试器时报告?
【发布时间】:2012-07-11 20:29:04
【问题描述】:

我正在尝试使用 FastMM 4.99 版(根据FastMM4.pas 顶部的评论)。我有 followed the instructions 使用带有堆栈跟踪的完整调试模式,并且当我在 IDE 调试器下运行我的 .exe 时发现泄漏。 例如

但是当我尝试从命令提示符运行可执行文件时,或者在 Windows 资源管理器中双击时,我没有报告任何泄漏。 UnicodeString 泄漏可能是虚假的,但我确信 TINiFile 泄漏是真实的。不使用调试器时如何使 FastMM 报告/日志泄漏?

更新:该项目还使用 madExcept 3.0n:.dpr 文件确实将 FastMM4 作为其使用子句中的第一项。还需要什么才能让这两者共存吗?

【问题讨论】:

    标签: delphi delphi-xe2 fastmm


    【解决方案1】:

    您没有正确配置FastMM4Options.inc。从随版本 4.97 分发的文件中,它在第 405 行附近:

    {Set this option to require the presence of the Delphi IDE to report memory
     leaks. This option has no effect if the option "EnableMemoryLeakReporting"
     is not also set.}
    {.$define RequireIDEPresenceForLeakReporting}
    

    确保. 在最后一行($define 之前)并重新构建您的项目。

    @wades 发现还有另一个设置,就在我提到的RequireDebuggerPresenceForLeakReporting 的下方,默认为开启。通过在左大括号后添加一个句点来禁用它:

    {Set this option to require the program to be run inside the IDE debugger to
     report memory leaks. This option has no effect if the option
     "EnableMemoryLeakReporting" is not also set.}
    {$define RequireDebuggerPresenceForLeakReporting}
    

    (应@wades 的要求添加到此答案中。)

    【讨论】:

    • 不,不是这个。 RequreIDEPresenceForLeakReporting 已关闭。
    • 但这是一个线索...感兴趣的选项原来是 RequireDebuggerPresenceForLeakReporting,在 v4.99 中默认为“on”。
    • @wades,谢谢。您应该发布一个答案,或者如果您愿意,我会更新我的答案以包含它,以供将来可能会发现此问题的其他人使用。 (不知道当我发布上面的答案时我是如何错过它的,因为它是 FastMM4Options.inc 文件中的下一个条目。)
    • 请更新答案以添加对 RequireDebugger... 标志的提及,我会接受。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-14
    • 2015-11-30
    • 2015-03-23
    • 2010-11-01
    • 1970-01-01
    相关资源
    最近更新 更多