Page 1 of 1
ADO Memory and handle count
Posted: 24.04.2008, 10:30
by sandeep_c24
I have a small app using ADO and MSSQL 2005 and it seems the memory usage keeps increasing. I looked at the task manger and I could see Memory and number of handles increasing.
I added FastMM4 to my project but it did not report any leaks. Does anyone have any idea as to what is going on?
Sandeep
Posted: 24.04.2008, 21:11
by mdaems
Sure you're not creating new connections/queries at runtime without closing/destroing them?
Maybe a stupid questing, but I assume FastMM4 would not call that scenario a memory leak.
Mark
Posted: 24.04.2008, 22:15
by sandeep_c24
No, I am not creating any new connections or queries. I have a test app with one connection and one query and I close and open the query about 10 times.
I was using FastMM4 to check why the memory usage was increasing. It could be because of increase in handles or some objects not being freed. I was not sure what was going on, so I tried FastMM4.
Sandeep
Posted: 24.04.2008, 23:36
by mdaems
Mmm, that smells like a memory leak indeed...
I know we have had memory issues with other engines when the resultset had multiple columns. (So not when 1 column was involved) Maybe this is similar?
Mark
Posted: 25.04.2008, 00:00
by sandeep_c24
Hi Mark
I have been trying to find what is going on, I don't have enough knowledge about COM stuff but I think it could be to do something with COM stuff.
Any suggestions what I should look at or try to do. We had to move one of our clients to MSSQL2005 and it can be accessed only using ADO so it is a bit urgent for us to try and fix this issue.
All suggestions are welcome.
Sandeep
Posted: 18.05.2008, 07:57
by sandeep_c24
I have been trying to find the cause of handle leaks in ADO and what I have found is if following line is used
Code: Select all
AdoRecordSet.Open(FAdoCommand, EmptyParam, adOpenForwardOnly, adLockOptimistic, adCmdUnspecified);
instead of
Code: Select all
AdoRecordSet.Open(FAdoCommand, EmptyParam, adOpenForwardOnly, adLockOptimistic, adAsyncFetch);
in unit ZDbcAdoStatement then the handles are not lost. I also compared it to Standard ADO components in Delphi and if I use eoAsyncFetch option in TADOQuery I get similar behavior as in Zeos with adAsyncFetch.
I'll do a bit more investigation and see what that's all about.
I was wondering if anyone is using Zeos and ADO?
Regards
Sandeep