ADO Memory and handle count

Forum related to ADO

Moderators: gto, cipto_kh, EgonHugeist

sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

ADO Memory and handle count

Postby sandeep_c24 » 24.04.2008, 10:30

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

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 24.04.2008, 21:11

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
Image

sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Postby sandeep_c24 » 24.04.2008, 22:15

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

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 24.04.2008, 23:36

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
Image

sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Postby sandeep_c24 » 25.04.2008, 00:00

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

sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Postby sandeep_c24 » 18.05.2008, 07:57

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


Return to “ADO”

Who is online

Users browsing this forum: No registered users and 1 guest