Board index » delphi » Memory Leaks.

Memory Leaks.


2003-07-30 05:19:56 AM
delphi134
In one of my middle tiers i was using ADO with MySQL ODBC driver . It was
leaking something like 1 gb a day and i had to screen and restart my own
service once a day. It was same before with ADO and SQL Server but it was
leaking 250 MB / day and it was stalling once per 2-3 days. Now the same
code , ( i only had to change connection data and execute statements which
required nil,nil parameters and i took out coinits) works with DBExpress and
MYSQL. Not only memory leaks disappeared completely , but it runs much much
faster now. It is a http server like middletier and works on indy http
implementation. The system serves smt like 275000 requests on a busy day and
in all of them i have db access since everything is logged and session
variable checked . It is running for 6 days now and not one single byte
memory leak, no restart etc.
Is there anyone there who has had a similar experience? Since dbExpress
hasnt every driver i dont want to completely abandon ADO. I searched news
groups and there were similar posts about memory leaks but no real solution.
I know it can be done with ADO. I have tested with IIS and done 300000
requests the same way in a asp app and iis didnt leak so the problem must be
with the implementation. (I dont think it is delphi releated since there
are those memory leak posts on c++ newsgroups of MS).
Thanks in advance for any help.
 
 

Re:Memory Leaks.

You should find this memory leak yourself - most probable it is in your
application. Could you create a simple sample that reproduces this leak?
About speed: with http applications you may often use server-side cursor and
it will be faster.
----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.
"Adem Meral" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях
следующе? news:XXXX@XXXXX.COM...
Quote
In one of my middle tiers i was using ADO with MySQL ODBC driver . It was
leaking something like 1 gb a day and i had to screen and restart my own
service once a day. It was same before with ADO and SQL Server but it was
leaking 250 MB / day and it was stalling once per 2-3 days. Now the same
code , ( i only had to change connection data and execute statements which
required nil,nil parameters and i took out coinits) works with DBExpress
and
MYSQL. Not only memory leaks disappeared completely , but it runs much
much
faster now. It is a http server like middletier and works on indy http
implementation. The system serves smt like 275000 requests on a busy day
and
in all of them i have db access since everything is logged and session
variable checked . It is running for 6 days now and not one single byte
memory leak, no restart etc.

Is there anyone there who has had a similar experience? Since dbExpress
hasnt every driver i dont want to completely abandon ADO. I searched news
groups and there were similar posts about memory leaks but no real
solution.

I know it can be done with ADO. I have tested with IIS and done 300000
requests the same way in a asp app and iis didnt leak so the problem must
be
with the implementation. (I dont think it is delphi releated since there
are those memory leak posts on c++ newsgroups of MS).

Thanks in advance for any help.



 

Re:Memory Leaks.

Easy , do a simple loop in a thread. (this thread is idPeerThread of indy
http imple.)
CoInitialize(nil);
DBConn:=TAdoConnection.create;
DBQuery:=TAdoQuery.create;
.....
DBQuery.sql.clear;
DBQuery.active:=false;
freeandnil (dbquery);
dbconn.close;
freeandnil (dbconn);
couninitialize;
now do this 275000 times a day like my app and it leaks 1 gb with MyODBC
driver and 250 MB with SQL Server OleDB driver.
The same code with DBExpress components doesnt leak anything.
(i used tpower memsleuth and it reported 0 leak)