MBL1175
asked on
Crystal Reports v10, & Delphi 5 possible Memory Leak
XP, Crystal Reports v10, & Delphi 5 possible Memory Leak
When launched for the first time, the following process grabs 29MB of memory and releases 5MB.
Each time the report process is subsequently re-launched, additional memory(between 1MB & 2MB) is grabbed and retained.
The 24MB retained from the initial launch of the report appears to be re-used each time a crystal report is launched, so that's not an issue, it's just the extra 1 or 2MB eaten up every time a report is launched.
How can I get it back without having to close down the application?
Cryst := TCrysPreview.Create(nil); // uses 630K
With Cryst do
begin
SetApplicationReportPath(A pplication .Title);
ReportName := trim(Q.FieldByName('REPORT _FILE').As String)+'. RPT';
SetReport; // uses 16.3MB
Report.Database.SetDataSou rce(RQ.Rec ordset,3,1 ); // uses 8.7MB
ShowModal; //uses 4MB
end;
Cryst.Free; // frees up 5MB
-------------------------- ---------- --------
Cheers
Ray
When launched for the first time, the following process grabs 29MB of memory and releases 5MB.
Each time the report process is subsequently re-launched, additional memory(between 1MB & 2MB) is grabbed and retained.
The 24MB retained from the initial launch of the report appears to be re-used each time a crystal report is launched, so that's not an issue, it's just the extra 1 or 2MB eaten up every time a report is launched.
How can I get it back without having to close down the application?
Cryst := TCrysPreview.Create(nil); // uses 630K
With Cryst do
begin
SetApplicationReportPath(A
ReportName := trim(Q.FieldByName('REPORT
SetReport; // uses 16.3MB
Report.Database.SetDataSou
ShowModal; //uses 4MB
end;
Cryst.Free; // frees up 5MB
--------------------------
Cheers
Ray
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Anothe rsuggestion, from my own memory leak issues, is to create your Cryst as follows:
Cryst := TCrysPreview.Create(Form1)
What I ran into was that creating any data sources TADOQuery, TADOTable, passing nil as the owner will cause the Delphi code to cause a memory leak. This could also be true for Crystal. Try it out and let me know.