Search code examples
delphimemory-leaksloggingdelphi-2006fastmm

FastMM4, how to read the log file?


i'am working on an software,so i have just started using FastMM4 (for real) in my project.

i have found on the net on about how to get the line number in FastMM4,i got the line number but i can figure out what does the other information in the log means?

i have this in the log file

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

in this the leak is

   46A257 [u_home.pas][u_home][u_home.TForm1.SpeedButton1Click][80] {<-memory leak is here, but what are the Other detections?}

my code

 procedure TForm1.SpeedButton1Click(Sender: TObject);
  var
  str : TStringList;
  begin
  str := TStringList.Create;  {<--im not freeing the, so leak}

  end;

enter image description here

and here is the call stack enter image description here

i searched on net but i do not know what are the other detections...

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]

im using delphi 2006

i have opened and tried the same in delphi 6, delph 7 also

checked i have found this related to fastMM$ detectiong and registration of some leaks which is already in delphi. How to track down tricky memory leak with fastMM? and this for registering the leak but are they bugs? Using FastMM4, how to register leaked string?

Also FastMM4, Delphi6, Leak of TApplication?

OR are they just the steps leading to the memory leak?


Solution

  • What you have in the log there is the call stack that resulted in the memory allocation that leaked.

    You can see how useful it is in the call stack in your question. Imagine that you only had the top line, the call that resulted in the leak

    402E86 [system.pas][System][System.@GetMem][2648]
    

    That information on its own is pretty much useless since all heap allocations go through GetMem. It is the call stack that points you to the events that led up to the call to GetMem. And that's what pinpoints what caused the leak.