Einzelnen Beitrag anzeigen

Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: FastMM Memory Leaks : Lesen und verstehen von Stacktrace

  Alt 8. Sep 2014, 12:36
Folgendes Projekt

Delphi-Quellcode:
program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

uses
  FastMM4,
  Unit2 in 'Unit2.pas';

begin
   ReportMemoryLeaksOnShutdown := True;
   createLeak();
end.
Delphi-Quellcode:
unit Unit2;

interface
   procedure createLeak(); forward;

implementation

procedure createLeak();
begin
   TObject.Create();
end;

end.
erzeugt folgende Ausgabe:
Code:
--------------------------------2014/9/8 13:33:46--------------------------------
A memory block has been leaked. The size is: 12

This block was allocated by thread 0x1700, and the stack trace (return addresses) at the time was:
4040D6 [System.pas][System][@GetMem$qqri][4305]
4048CB [System.pas][System][TObject.NewInstance$qqrv][15436]
404ECE [System.pas][System][@ClassCreate$qqrpvzc][16746]
404900 [System.pas][System][TObject.$bctr$qqrv][15500]
405B50 [System.pas][System][@StartExe$qqrp23System.PackageInfoTablep17System.TLibModule][21884]
41D35B [Unit2.pas][Unit2][createLeak$qqrv][10]
41F3FD
76B3338A [BaseThreadInitThunk]
777F9F72 [Unknown function at RtlInitializeExceptionChain]
777F9F45 [Unknown function at RtlInitializeExceptionChain]

The block is currently used for an object of class: TObject

The allocation number is: 110

Current memory dump of 256 bytes starting at pointer address 7EF6F520:
10 14 40 00 00 00 00 00 31 85 50 19 78 85 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
. . @  . . . . . 1  …  P . x …  B . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

--------------------------------2014/9/8 13:33:46--------------------------------
This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):

5 - 12 bytes: TObject x 1

Note: Memory leak detail is logged to a text file in the same folder as this application. To disable this memory leak check, undefine "EnableMemoryLeakReporting".

Gehe von unten die letzten dir bekannten Units durch. In diesem Fall ist es
  • Unit2.pas
  • Die Methode createLeak
  • Zeile 10

Das wird nie freigegeben.
  Mit Zitat antworten Zitat