我有一个空项目(它只包含一个表单)。如果我将这一行添加到项目'USES GR32_Image;‘中并运行应用程序,FastMM会在程序中显示leak。FastMM设置为完全调试。我的程序中没有代码--除了Delphi IDE生成的代码和'uses gr32‘行。
这份报告毫无意义。这是完整的日志:http://pastebin.com/Yhev3rJ2
下面是源代码:http://pastebin.com/VjRrRiS8
我以前使用过Graphics32设备,从来没有遇到过问题。为什么我会有这种泄漏,为什么FastMM不能生成正确的报告?
发布于 2011-01-08 06:14:42
使用完整的调试信息编译你的应用,然后在链接器选项中,确保你的调试信息在.EXE和/或.MAP文件中。
然后使用FullDebugMode运行FastMM,并在问题中复制/粘贴生成的.TXT文件。
有关更多提示,请参阅this post。
编辑:
好的第一步是对您的.TXT文件执行如下操作:
find "The allocation number is" < fastmmlog.txt | sort /R这为您提供了第一个分配编号,在本例中为281。
然后,在.TXT中搜索分配编号:
--------------------------------2011/1/7 23:31:03--------------------------------
A memory block has been leaked. The size is: 20
This block was allocated by thread 0x1540, and the stack trace (return addresses) at the time was:
402D80 [System][System][@GetMem]
40388F [System][System][TObject.NewInstance]
403C12 [System][System][@ClassCreate]
4038C4 [System][System][TObject.Create]
403C12 [System][System][@ClassCreate]
403C6A [System][System][@AfterConstruction]
457922 [GR32_Bindings][GR32_Bindings][NewRegistry]
45807E [GR32_LowLevel][GR32_LowLevel][RegisterBindings]
458152 [GR32_LowLevel][GR32_LowLevel][GR32_LowLevel]
404373 [System][System][InitUnits]
4043DB [System][System][@StartExe]
The block is currently used for an object of class: TList
The allocation number is: 281在这里您可以看到,NewRegistry与您的泄漏有关。
从那里,您可以开始调试,以找出它泄漏的原因。
--jeroen
发布于 2011-01-08 00:52:08
如果您使用的是完整版FastMM4,请启用FullDebugMode。还要打开详细的贴图生成,以帮助进行堆栈跟踪。检查该单元的单元初始化部分,查看是否有任何问题。
发布于 2011-01-10 17:57:42
两个问题都解决了。
感谢所有人的参与。
https://stackoverflow.com/questions/4627682
复制相似问题