Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi FastMM Optionen (https://www.delphipraxis.net/94732-fastmm-optionen.html)

guidobrose 26. Jun 2007 08:57


FastMM Optionen
 
Hallo

ich habe mir jetzt mal FastMM4 herunter geladen, um evtl. Speicherprobleme in meiner Anwendung finden zu knnen.

Ich habe die Unit auch brav nach Anleitung in die uses Klausel eingebunden und bekomme in meiner Testanwendung auch gleich einen entsprechenden Hinweis. Jetzt htte ich natrlich gerne eine LOG Datei und eine entsprechend detailiertere Aufschlsselung, bin aber anscheinend zu bld dazu den FullDebugMode einzuschalten. Wie geht denn das nun?

Guido

Nuclear-Ping 26. Jun 2007 09:27

Re: FastMM Optionen
 
Unter Projektoptionen -> Bedingungen

FullDebugMode;LogMemoryLeakDetailToFile

guidobrose 26. Jun 2007 10:48

Re: FastMM Optionen
 
Sorry, den Menpunkt kann ich bei mir nicht finden. Ich verwende TurboExplorer.

Ich dachte, das msste in der FastMMOptions.inc eingestellt werden, aber ich hab keine Ahnung wie.

bigg 26. Jun 2007 11:22

Re: FastMM Optionen
 
In der von dir genannten Include-Datei findest du verschiedene Compiler-Schalter, die eventuell mit einem Punkt {.$} versehen sind. Diese mtest du entfernen und deine Anwendung neu bersetzen.


btw: Die Log Optionen heissen auch alle *Log*.

Luckie 2. Jul 2007 12:41

Re: FastMM Optionen
 
Da habe ich auch gemacht, nur kann ich nirgends eine Log-Datei finden:
Delphi-Quellcode:
{Set the following option to do extensive checking of all memory blocks. All
 blocks are padded with both a header and trailer that are used to verify the
 integrity of the heap. Freed blocks are also cleared to to ensure that they
 cannot be reused after being freed. This option slows down memory operations
 dramatically and should only be used to debug an application that is
 overwriting memory or reusing freed pointers. Setting this option
 automatically enables CheckHeapForCorruption and disables ASMVersion.
 Very important: If you enable this option your application will require the
 FastMM_FullDebugMode.dll library. If this library is not available you will
 get an error on startup.}
{$define FullDebugMode}

  {Set this option to perform "raw" stack traces, i.e. check all entries on the
   stack for valid return addresses. Note that this is significantly slower
   than using the stack frame tracing method, but is usually more complete. Has
   no effect unless FullDebugMode is enabled}
  {$define RawStackTraces}

  {Set this option to check for user code that uses an interface of a freed
   object. Note that this will disable the checking of blocks modified after
   being freed (the two are not compatible). This option has no effect if
   FullDebugMode is not also enabled.}
  {.$define CatchUseOfFreedInterfaces}

  {Set this option to log all errors to a text file in the same folder as the
   application. Memory errors (with the FullDebugMode option set) will be
   appended to the log file. Has no effect if "FullDebugMode" is not set.}
  {$define LogErrorsToFile}

  {Set this option to log all memory leaks to a text file in the same folder as
   the application. Memory leak reports (with the FullDebugMode option set)
   will be appended to the log file. Has no effect if "LogErrorsToFile" and
   "FullDebugMode" are not also set. Note that usually all leaks are always
   logged, even if they are "expected" leaks registered through
   AddExpectedMemoryLeaks. Expected leaks registered by pointer may be excluded
   through the HideExpectedLeaksRegisteredByPointer option.}
  {$define LogMemoryLeakDetailToFile}

  {Deletes the error log file on startup. No effect if LogErrorsToFile is not
   also set.}
  {.$define ClearLogFileOnStartup}

  {Loads the FASTMM_FullDebugMode.dll dynamically. If the DLL cannot be found
   then stack traces will not be available. Note that this may cause problems
   due to a changed DLL unload order when sharing the memory manager. Use with
   care.}
  {.$define LoadDebugDLLDynamically}
Und wo muss die FastMM_FullDebugMode.dll hin? Meine Anwendung startet auch ohne diese DLL, obwohl die Option FullDebugMode aktiviert ist.

Christian Seehase 2. Jul 2007 13:55

Re: FastMM Optionen
 
Moin Michael,

die Log-Datei solltest Du in dem Verzeichnis finden, in dem sich auch die EXE des zu prfenden Programmes befindet.
Die DLL muss vom OS zu finden sein, wre also im SYSTEM32 gut aufgehoben.

Luckie 2. Jul 2007 14:05

Re: FastMM Optionen
 
Ich habe sie jetzt in das Verzeichnis gelegt, in dem auch die Exe erstellt wird. Aber da sehe ich nirgends eine Logdatei. Ausserdem braucht die IDE jetzt ewig lange, um das Programme zu beenden, wenn ich das Programm schliesse.

Jetzt ist eine Aufgetaucht. Kann man auch irgendwie raus bekommen in welcher Zeile im Quellcode das Speicherleck auftaucht?

CCRDude 2. Jul 2007 14:27

Re: FastMM Optionen
 
Wenn die log-Datei aufgetaucht ist, enthlt sie auch Callstacks. Ich nehm hier mal ein Beispiel aus einem alten Log, das ich hier noch nicht ordentlich weggesubert hab:

Zitat:

Stack trace of when the object was allocated (return addresses):
402E7E [System][@GetMem]
403EC7 [System][TObject.NewInstance]
404172 [System][@ClassCreate]
403EFC [System][TObject.Create]
465615 [..\..\pkFileSysWin.pas][pkFileSysWin][WindowsFindFileList][136]
465B3F [..\..\pkFileSysWin.pas][pkFileSysWin][WindowsFindFileList][214]
46618F [..\pkFileSysWinTest.pas][pkFileSysWinTest][pkFileSysWinTestExecute][50]
466979 [..\pkFileSysWinTest.pas][pkFileSysWinTestDconsole][TestMain][107]
Datei, Funktion und Zeile lsst sich dort finden (von unten nach oben die Aufrufreihenfolge).
In diesem Beispiel ruft TestMain in Zeile 108 die Funktion pkFileSysWinTestExecute auf, welche in Zeile 50 WindowsFindFileList aufruft, welches in Zeile 214 WindowsFindFileList aufruft (overloaded), welches in Zeile 136 ein Objekt anlegt, das spter nicht freigegeben wurde (weiter oben im Log wre zu finden gewesen, da es sich dabei im ein TStringList handelt).

Luckie 2. Jul 2007 14:52

Re: FastMM Optionen
 
Ich bekomme leider nur so eine Ausgabe:
Code:
--------------------------------2007/7/2 15:58:57--------------------------------
A memory block has been leaked. The size is: 36

Stack trace of when this block was allocated (return addresses):
402FDE
43189E
432E51 
4331C7 
437656 
4388CD
66C94A
405113 
40517B
407BDF

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

The allocation number is: 238

Current memory dump of 256 bytes starting at pointer address 1032E70:
00 00 00 00 0F 00 00 00 F0 21 10 86 63 9C 80 80 00 00 00 00 FF FF FF 00 00 00 00 00 00 00 00 00
84 41 44 FC 80 80 80 80 00 00 00 00 C1 31 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FE 00 00 00 DE 2F 40 00 A1 55 40 00 CC 55 40 00 D7 04 41 00 1F AF 40 00 DE 2F 40 00 A1 55 40 00
E4 55 40 00 5E 7A 40 00 44 6A 93 7C FA 2F 40 00 ED 54 40 00 3A 85 4B 00 AB 50 40 00 5F 53 40 00
79 CC 66 00 4E E6 91 7C D7 6F 81 7C E0 6F 81 7C 00 00 00 00 24 00 00 00 00 00 00 00 B1 BF 22 F7
0C FE 68 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
80 80 80 80 4E 40 DD 08 00 00 00 00 C1 22 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
03 01 00 00 24 B0 40 00 1B 30 40 00 E9 27 42 00 50 26 42 00 5D 24 42 00 6D 59 43 00 15 5F 43 00
. . . . . . . .   !  .   c       . . . .       . . . . . . . . .
  A D           . . . .   1  . . . . . . . . . . . . . . . . . .
  . . .   /  @  .   U @  .   U @  .   . A . .   @  .   /  @  .   U @  .
  U @  . ^  z @  . D j   |    /  @  .   T @  . :   K .   P @  . _  S @  .
y   f . N     |    o   |    o   |  . . . . $  . . . . . . .     "
.   h .                                                      
        N @    . . . . .   " . . . . . . . . . . . . . . . . . .
. . . . $    @  . . 0  @  .   ' B . P & B . ] $  B . m Y C . . _  C .

--------------------------------2007/7/2 15:58:58--------------------------------
A memory block has been leaked. The size is: 52

Stack trace of when this block was allocated (return addresses):
402FDE
404453 
40481A
60D63A
7C9FB91C [SHGetDesktopFolder]
60C5A0 
60D408 
60D4A7 
60D5CE
7E36B6A3 [OffsetRect]

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

The allocation number is: 37897

Current memory dump of 256 bytes starting at pointer address 103FB10:
40 9A 60 00 48 0F 17 00 50 16 17 00 F0 93 03 01 18 84 14 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 30 A4 01 01 D5 5C EB FE 80 80 80 80 80 80 80 80 00 00 00 00 B1 BA 03 01
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BB 92 00 00 A1 55 40 00 CC 55 40 00 7B 56 40 00
2A 5E 40 00 CF 5D 40 00 A5 48 0F 77 8A 4B 0F 77 2A 5E 40 00 CF 5D 40 00 16 88 36 7E ED 54 40 00
4B 64 40 00 D5 63 40 00 27 45 40 00 6A 44 40 00 65 48 40 00 D4 34 45 00 E2 C7 42 00 D8 C5 42 00
55 DB 45 00 26 00 00 00 00 00 00 00 36 B1 AE 71 0C FE 68 00 80 80 80 80 80 80 80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 C9 4E 51 8E 80 80 80 80 80 80
80 80 80 80 80 80 80 80 00 00 00 00 51 FB 03 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
@    `  . H . . . P . . .     . . .   . . . . . . . . . . . . . .
. . . . . . . . 0    . .   \                      . . . .     . .
. . . . . . . . . . . . . . . .     . .   U @  .   U @  . {  V @  .
*  ^  @  .   ] @  .   H . w   K . w *  ^  @  .   ] @  . .   6  ~    T @  .
K d @  .   c @  . ' E @  . j D @  . e H @  .   4  E .     B .     B .
U   E . & . . . . . . . 6      q .   h .                      
                                              N Q            
                . . . . Q   . . . . . . . . . . . . . . . . . .

--------------------------------2007/7/2 15:58:58--------------------------------
This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):

1 - 4 bytes: Unknown x 6
5 - 12 bytes: Unknown x 9
13 - 20 bytes: TIEScrollBarParams x 6, TIEMouseWheelParams x 3, TIEFileBuffer x 15, TList x 63, String x 3, Unknown x 9
21 - 28 bytes: TIEVSoftShadow x 6, TPen x 15, TBrush x 30
29 - 36 bytes: TSizeConstraints x 9, TMargins x 9, TPadding x 9, TFont x 24, Unknown x 5
37 - 52 bytes: TPicture x 6, TShellFolder x 19, Unknown x 6
53 - 68 bytes: TStringList x 19, TTimer x 6, TBitmap x 27, String x 2, Unknown x 9
85 - 100 bytes: TShellChangeThread x 2, TBitmapCanvas x 3, TControlCanvas x 6
101 - 116 bytes: TBitmapImage x 27, TIEMask x 3
133 - 148 bytes: TIETransitionEffects x 3, TIELayer x 9
149 - 164 bytes: TIEBitmap x 15
261 - 292 bytes: Unknown x 3
613 - 676 bytes: TIEEdit x 3
757 - 836 bytes: TIETextControl x 3
1141 - 1252 bytes: Unknown x 3
1861 - 2052 bytes: Unknown x 5
2053 - 2260 bytes: Unknown x 3
2261 - 2484 bytes: TImageEnVect x 3

The sizes of leaked medium and large blocks are (excluding expected leaks registered by pointer): 38580, 164020, 164020, 18612, 16308, 17076, 164020, 73908, 41140, 4276

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".

Bernhard Geyer 2. Jul 2007 14:55

Re: FastMM Optionen
 
Du brauchst mehr Debuginfos (z.B. TD32-Debuginfos).


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:33 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz