About the log
I Created a project as below to explain the log file.
program Project1;
uses
CnMemProf,
Forms;
{$R *.RES}
begin
mmPopupMsgDlg := True;
mmShowObjectInfo := True;
mmUseObjectList := True;
mmSaveToLogFile := True;
TForm.Create(nil);
end.
First run the application, when the application exit, an messagebox report memory leak will show (if you check the option: show messagebox). If you open the log file, you can found where the memory leak is, but you can not know what is the memory leak object.
Open CnMemprof.pas, go to lin 71, modify this line to {$DEFINE LOGRTTI}, compile and run the application again, when you exit, you may recived some IDE exception report, ignore them. Then open the log file, you will see the log as below:
:::::::::::::::::::::::::::::::::::::::::::::::::::::
2005-12-23 10:45:20
Application total run time: 0 hour(s) 0 minute(s) 0 second(s)。
There are 79 allocated before replace memory manager.
HeapStatus.TotalAddrSpace: 1024 KB
HeapStatus.TotalUncommitted: 1008 KB
HeapStatus.TotalCommitted: 16 KB
HeapStatus.TotalFree: 12 KB
HeapStatus.TotalAllocated: 3 KB
TotalAllocated div TotalAddrSpace: 0%
HeapStatus.FreeSmall: 5 KB
HeapStatus.FreeBig: 0 KB
HeapStatus.Unused: 6 KB
HeapStatus.Overhead: 0 KB
Objects count in memory: 15
1) 0000000000D91678 - 67($0043)Byte - Not an object
2) 0000000000D91E00 - 39($0027)Byte - Not an object
3) 0000000000D91F7C - 767($02FF)Byte - : TForm (760 Byte) - In Forms.pas
4) 0000000000D9228C - 42($002A)Byte - MS Sans Serif : TFont (36 Byte) - In Graphics.pas
5) 0000000000D912A8 - 39($0027)Byte - (no name): TSizeConstraints (32 Byte) - In Controls.pas
6) 0000000000D922B4 - 30($001E)Byte - (no name): TBrush (24 Byte) - In Graphics.pas
7) 0000000000D92318 - 79($004F)Byte - (no name): TControlScrollBar (72 Byte) - In Forms.pas
8) 0000000000D92364 - 78($004E)Byte - (no name): TControlScrollBar (72 Byte) - In Forms.pas
9) 0000000000D923B0 - 58($003A)Byte - (no name): TIcon (52 Byte) - In Graphics.pas
10) 0000000000D923E8 - 30($001E)Byte - Not an object
11) 0000000000D92404 - 106($006A)Byte - (no name): TControlCanvas (100 Byte) - In Controls.pas
12) 0000000000D9246C - 42($002A)Byte - MS Sans Serif : TFont (36 Byte) - In Graphics.pas
13) 0000000000D92494 - 34($0022)Byte - (no name): TPen (28 Byte) - In Graphics.pas
14) 0000000000D924B4 - 30($001E)Byte - (no name): TBrush (24 Byte) - In Graphics.pas
15) 0000000000D924D0 - 38($0026)Byte - Not an object
You will see a TForm object is not freed, the leak form's name is '', and it is 760 Byte.
3) 0000000000D91F7C - 767($02FF)Byte - : TForm (760 Byte) - In Forms.pas
You can also see other objects not freed, But they are owned by a TFrom object.
If you fixed the leak, you will recive the log as below:
:::::::::::::::::::::::::::::::::::::::::::::::::::::
2005-12-23 10:59:41
Application total run time: 0 hour(s) 0 minute(s) 0 second(s)。
There are 79 allocated before replace memory manager.
HeapStatus.TotalAddrSpace: 1024 KB
HeapStatus.TotalUncommitted: 1008 KB
HeapStatus.TotalCommitted: 16 KB
HeapStatus.TotalFree: 13 KB
HeapStatus.TotalAllocated: 1 KB
TotalAllocated div TotalAddrSpace: 0%
HeapStatus.FreeSmall: 0 KB
HeapStatus.FreeBig: 0 KB
HeapStatus.Unused: 13 KB
HeapStatus.Overhead: 0 KB
Objects count in memory: 0, No memory leak.
Sorry for my english.
|