Subject | Re: [firebird-support] Re: Possible memory leak in FBCLIENT.DLL |
---|---|
Author | Stefan Heymann |
Post date | 2006-11-09T08:16:08Z |
> Err, are you sure that it's the fbclient.dll that's losing memory?I have written a little Delphi program to test what Bozzy said.
> Generally, an inactive dll isn't very resource hungry. Sounds to me
> as if the application isn't releasing some part of its connection.
I don't know if it's correct to use that measurement of memory usage
but a comparison with gds32.dll from IB602 shows that fbclient.dll
decreases the dwTotalPhys value *much* faster than gds32.dll.
This is the complete program, a console application, which has no
database connection at all:
program FbClientLeak; {$APPTYPE CONSOLE}
// Does fbclient.dll leak memory?
uses
Windows, SysUtils;
var
i : integer;
Handle : THandle;
MemStatus : TMemoryStatus;
begin
i := 0;
repeat
inc (i);
Writeln ('Test ' + IntToStr (i));
Handle := LoadLibrary ('fbclient.dll');
if Handle = 0 then
Writeln ('>>> Load ERROR: ' + IntToStr (GetLastError));
if NOT FreeLibrary (Handle) then
Writeln ('>>> Free ERROR: ' + IntToStr (GetLastError));
GlobalMemoryStatus (MemStatus);
Writeln ('Free Memory: ' + IntToStr (MemStatus.dwAvailPhys) +
' of ' + IntToStr (MemStatus.dwTotalPhys) +
' = ' + FloatToStrF (MemStatus.dwAvailPhys /
MemStatus.dwTotalPhys * 100.0, ffGeneral, 5, 1) + ' %');
Writeln;
Sleep (50);
until false; // This will be cancelled via Ctrl+C ... ;-)
end.
Best Regards
Stefan
--
Stefan Heymann
www.destructor.de/firebird