PDA

View Full Version : Memory Leaks nto Console Application


jackfirst72
26-Oct-2007, 08:36 AM
Hi,
I've been using EurekaLog within Form applications for a while and I haven't got any troubles to get memory leaks reports.
But now I'm trying to remodel a console application and I'm not able to get a correct report about memory leak.
Precisions about the EurekaLog configuration within the Delphi 2007 for Win32 "Project/EurekaLog Options" menu. I just activated EurekaLog and check all chexboxes about memory leaks.
I know that the report is generating into the console but also in my home directory if I didn't supplied a log path in the configuration. With the following code, no memory leak report of any kind is generated (I mean just no output file):

program Project1;

{$APPTYPE CONSOLE}

uses
ExceptionLog,
SysUtils,
Classes;


var
MyList : TStringList;

begin

try
MyList := TStringList.Create;
Writeln('Démarrage ...');
Sleep(1000);
except
on E:Exception do
begin
Writeln(E.Classname, ': ', E.Message);
Sleep(5000);
end;
end;

end.

In the other hand, with the same code just modified a little bit like this one :

program Project1;

{$APPTYPE CONSOLE}

uses
ExceptionLog,
SysUtils,
Classes;


procedure GenerateMemoryLeaks;
var
MyList : TStringList;
begin
MyList := TStringList.Create;
end;


begin

try
GenerateMemoryLeaks;
Writeln('Démarrage ...');
Sleep(1000);
except
on E:Exception do
begin
Writeln(E.Classname, ': ', E.Message);
Sleep(5000);
end;
end;

end.

Now I get a report, but no the same than in Form applications !
Report of a memory leak generated into a form application : see "EurekaLogFormApplicLeak.PNG" attachment ("MemoryLeak: Type=TStringList; Total size=56; Count=1").
Report of a memory leak generated into a console application : see "EurekaLogConsoleLeak.PNG" attachment ("Exception Thread: ID=TStringList; Priority=56; Class=1;").

Thanks a lot for your help.

Another simple question. I read some lines about how to activate/desactivate memory leak reproting at run time, but I'm still not able to do it ! What's the procedure or methods to use ?

Thanks again and "bravo" for your product.

admin
30-Oct-2007, 08:43 AM
Hi,

the first problem is unluckily related to a Delphi Linker bug (from Delphi 2005 to 2007) that did not created Debug Info for source lines into the main Project Begin/End.

A workaround is just use your second code! :)

The second bug is just fixed in the last 6.0.9 version (just released).

jackfirst72
30-Oct-2007, 01:48 PM
Hi again,
First of all thank you for your answer.
I just need some precisions, so here are my 3 questions :

1. When you say The second bug is just fixed in the last 6.0.9 version (just released)., you're talking about this
Now I get a report, but no the same than in Form applications !
Report of a memory leak generated into a form application : see "EurekaLogFormApplicLeak.PNG" attachment ("MemoryLeak: Type=TStringList; Total size=56; Count=1").
Report of a memory leak generated into a console application : see "EurekaLogConsoleLeak.PNG" attachment ("Exception Thread: ID=TStringList; Priority=56; Class=1;").

or about that

Another simple question. I read some lines about how to activate/desactivate memory leak reproting at run time, but I'm still not able to do it ! What's the procedure or methods to use ?


2. I could read that the functionnality of activating/deactivating memory leak at run time will be available in the 6.0.9 version ? Is it right ?

3. My company bought the 6.0.8 Enterprise version. How can we get the 6.0.9 ?

Thanks a lot.

jackfirst72
30-Oct-2007, 01:55 PM
Hello again,
Just to tell you to forget about my 3rd question. I found the link a few seconds ago.
Sorry.

jackfirst72
30-Oct-2007, 03:00 PM
And ... sorry again :o
Forget about my first question. I found the answer in the forum.
So it remains only the one about the functionnality of activating/deactivating memory leaks detection at run time !
Thanks a lot.

admin
30-Oct-2007, 03:49 PM
Hi,

no problem.

This new feature will be added in the next 6.1 version.

jackfirst72
31-Oct-2007, 06:34 AM
Ok, nice.
Thanks for your availability.

admin
31-Oct-2007, 07:08 AM
It's my job and I love it! ;)