我在网上找到了如何获取FastMM4中的“行号”的信息,我已经得到了行号,但是我不知道日志中的其他信息是什么意思?
日志文件中包含以下内容:
This block was allocated by thread 0x15F8, and the stack trace (return addresses) at the time was:
402E86 [system.pas][System][System.@GetMem][2648]
403A3B [system.pas][System][System.TObject.NewInstance][8824]
403DAA [system.pas][System][System.@ClassCreate][9489]
403A70 [system.pas][System][System.TObject.Create][8839]
46A257 [u_home.pas][u_home][u_home.TForm1.SpeedButton1Click][80] {<-memory leak is here, but what are the Other detections?}
443AAC [Controls.pas][Controls][Controls.TControl.Click][5226]
46958B [Buttons.pas][Buttons][Buttons.TSpeedButton.Click][1211]
46956B [Buttons.pas][Buttons][Buttons.TSpeedButton.MouseUp][1204]
443FB2 [Controls.pas][Controls][Controls.TControl.DoMouseUp][5352]
441BA0 [Controls.pas][Controls][Controls.TControl.SetMouseCapture][4379]
444042 [Controls.pas][Controls][Controls.TControl.WMLButtonUp][5364]
The block is currently used for an object of class: TStringList
The allocation number is: 440
在这种情况下,
leak
是泄漏的意思。 46A257 [u_home.pas][u_home][u_home.TForm1.SpeedButton1Click][80] {<-memory leak is here, but what are the Other detections?}
我的代码
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
str : TStringList;
begin
str := TStringList.Create; {<--im not freeing the, so leak}
end;
这里是调用栈
我在网上搜索了,但我不知道其他的检测方法...
402E86 [system.pas][System][System.@GetMem][2648]
403A3B [system.pas][System][System.TObject.NewInstance][8824]
403DAA [system.pas][System][System.@ClassCreate][9489]
403A70 [system.pas][System][System.TObject.Create][8839]
{Other then this}
46A257 [u_home.pas][u_home][u_home.TForm1.SpeedButton1Click][80] {<-memory leak is here, but what are the Other detections?}
{Other then this}
443AAC [Controls.pas][Controls][Controls.TControl.Click][5226]
46958B [Buttons.pas][Buttons][Buttons.TSpeedButton.Click][1211]
46956B [Buttons.pas][Buttons][Buttons.TSpeedButton.MouseUp][1204]
443FB2 [Controls.pas][Controls][Controls.TControl.DoMouseUp][5352]
441BA0 [Controls.pas][Controls][Controls.TControl.SetMouseCapture][4379]
444042 [Controls.pas][Controls][Controls.TControl.WMLButtonUp][5364]
我正在使用Delphi 2006
我也尝试在Delphi 6、Delphi 7
中打开并尝试了同样的内容。
检查过后,我发现这与FastMM$检测和注册一些已经存在于Delphi中的泄漏有关。以下是相关链接:如何跟踪FastMM引起的棘手内存泄漏?,以及用于注册泄漏的链接:使用FastMM4,如何注册泄漏的字符串?
此外,还有这个链接:FastMM4、Delphi6、TApplication泄漏?
它们只是导致内存泄漏的步骤吗?
46A257 [u_home.pas][u_home][u_home.TForm1.SpeedButton1Click][80]
? - PresleyDias46A257 [u_home.pas][u_home][u_home.TForm1.SpeedButton1Click][80]
。 - PresleyDias