将ReportMemoryLeaksOnShutdown的结果重定向到日志文件 [英] Redirect results from ReportMemoryLeaksOnShutdown to a log file

查看:1104
本文介绍了将ReportMemoryLeaksOnShutdown的结果重定向到日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我们的自动化单元测试添加内存泄漏检测。 ReportMemoryLeaksOnShutdown会检测到任何内存泄漏。最大的问题是它将结果打印到一个模态对话框,必须由用户手动关闭。在构建服务器上运行的自动化Unit测试中,这不起作用。



有没有办法将ReportMemoryLeaksOnShutdown的输出重定向到别的地方?例如,将信息打印到文件中?



doco说:


内存管理器将在
内存池关闭时扫描
在消息对话框中报告所有未注册的内存泄漏


我正在使用Delphi 2010

解决方案

下载完整版本来自sourceforge的 FastMM4 。您可以将其配置为写入FastMM4Options.inc中的日志文件;只需在下载中查看自述文件和FAQ文件,了解详细信息。具体来说,查找有关 FullDebugMode LogErrorsToFile 的信息,以及常见问题解答中的第三或第四个问题。


I want to add memory leak detection to our automated Unit tests. ReportMemoryLeaksOnShutdown will detect any memory leaks. The big problem is that it prints the results to a modal dialog box, which has to be closed manually by the user. This does not work in an automated Unit test running on a build server.

Is there any way to redirect the output from ReportMemoryLeaksOnShutdown to somewhere else? For example, print the information to a file?

The doco says:

the Memory Manager will scan the memory pool when it shuts down and report all unregistered memory leaks in a message dialog.

I am using Delphi 2010

解决方案

Download the full version of FastMM4 from sourceforge. You can configure it to write to a logfile in FastMM4Options.inc; just check the readme and FAQ files in the download for details. Specifically, look for information regarding FullDebugMode and LogErrorsToFile, and the third or fourth question in the FAQ readme.

这篇关于将ReportMemoryLeaksOnShutdown的结果重定向到日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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