CnPack Forum


 
iwancs (iwan)
普通灌水员
Rank: 2



UID 1210
Digest Posts 1
Credits 72
Posts 28
点点分 72
Reading Access 10
Registered 2005-10-21
Location Indonesia
Status Offline
Post at 2005-12-21 10:26  Profile | Blog | P.M.  | Yahoo!
CnMemProf

I'm trying to use CnMemProf wizard, but i have some difficulty to use them.
How to use them?i've tried create new project using CnMemProf wizard, but when i compile them, it need CnMemProf.Pas, but i couldn't find it anywhere. When i tried to save Unit1 from the wizard to CnMemProf it says project already has CnMemProf in it.
Please tell me how to create CnMemProf wizard?
Isn't it suppose to add CnMemProf on existing project to test the project memory usage??
I don't understand what, where and how to use them.
Thanks for your help

Iwan Cahyadi Sugeng
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2005-12-22 10:34  Profile | Blog | P.M. 
CnMemProf is in our cnpack component package. You need to install cnpack component package or just put the CnMemProf.pas in your search path.

You can download our latest cnpack component package from our website.
Top
iwancs (iwan)
普通灌水员
Rank: 2



UID 1210
Digest Posts 1
Credits 72
Posts 28
点点分 72
Reading Access 10
Registered 2005-10-21
Location Indonesia
Status Offline
Post at 2005-12-22 14:13  Profile | Blog | P.M.  | Yahoo!
Thx, i've tried it, and it works.
Is it true that i should put the four line into the project source file of my existing project??
One other thing, can i have an english log file ?? thank you
Top
iwancs (iwan)
普通灌水员
Rank: 2



UID 1210
Digest Posts 1
Credits 72
Posts 28
点点分 72
Reading Access 10
Registered 2005-10-21
Location Indonesia
Status Offline
Post at 2005-12-22 14:39  Profile | Blog | P.M.  | Yahoo!
sorry for the language question, i've try to trace the language problem, and i found that the language is defined in CnPack.inc. Maybe that's because i haven't installed the CnPack component yet.
Is there another way to changed the language ?

Can you tell me, how can i interprate the log, to trace where the problem exists?
Thanks for the help

Iwan Cahyadi Sugeng
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2005-12-22 17:25  Profile | Blog | P.M. 
Just copy the definitions of language items from CnConsts.pas to whereever you want.
And remove the {$I CnPack.inc}
That will work.

That's the way that extracting CnMemProf.pas from our CnPack compoent package.
Top
iwancs (iwan)
普通灌水员
Rank: 2



UID 1210
Digest Posts 1
Credits 72
Posts 28
点点分 72
Reading Access 10
Registered 2005-10-21
Location Indonesia
Status Offline
Post at 2005-12-22 22:13  Profile | Blog | P.M.  | Yahoo!
Yes, done that, but can u help with the next question, how can i read the log file you've created, so that i can understand where the problem is.
Thanks
Top
shenloqi
灌水处处长
Rank: 4



UID 34
Digest Posts 1
Credits 287
Posts 179
点点分 287
Reading Access 10
Registered 2003-3-15
Status Offline
Post at 2005-12-23 10:48  Profile | P.M. 
I recommend you use fastmm4 (with fulldebugmode) to inspect memory leak.You can get it from http://fastmm.sourceforge.net .
Both FastMM and CnMemProf are used SetMemoryManager to inspect memory leak, and FastMM4 is more effective at memory manager.
Top
shenloqi
灌水处处长
Rank: 4



UID 34
Digest Posts 1
Credits 287
Posts 179
点点分 287
Reading Access 10
Registered 2003-3-15
Status Offline
Post at 2005-12-23 11:03  Profile | P.M. 
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.
Top
iwancs (iwan)
普通灌水员
Rank: 2



UID 1210
Digest Posts 1
Credits 72
Posts 28
点点分 72
Reading Access 10
Registered 2005-10-21
Location Indonesia
Status Offline
Post at 2005-12-23 13:06  Profile | Blog | P.M.  | Yahoo!
Thx for the help, i've tried and it works, but i guess i'll try FastMM first, cause it still too hard to detect where the problem is.
In the log, it only define the unit name of the class, but not the unit name where the variable is defined.
Is there another way??

When i tried CnMemProf with my project, it says i have 22085 objects in list but i can't tell where the problem is

Thanks for the help
Top
marykeens
新警察
Rank: 1



UID 44280
Digest Posts 0
Credits 2
Posts 1
点点分 2
Reading Access 10
Registered 2009-11-4
Status Offline
Post at 2009-11-4 19:20  Profile | Blog | P.M. 
Hope to see more replies one of these days,especially feedbacks from the thread starter. Seems like this thread has been inactive for such a long time. Think topic should be closed.

Regards,
marykeens
Ordinateur portable pas cher
Top
 




All times are GMT++8, the time now is 2024-11-22 01:08

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.009867 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP