Memory problems

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zd
Posts: 78
Joined: Sun 01 Jul 2007 13:16

Memory problems

Post by zd » Fri 16 Mar 2012 18:33

Hello!

I have a table with around 30 columns and 30-40.000 records.

I try to select all the data from the table and display it in a VirtualTreeView.

The problem is that on a less powerful older computer the system slows down and eventually gives an "unable to allocate memory from operating system" EIBCError at the IBCQuery.Next; line.

If I do the same query in FlameRobin and fetch all rows my system doesn't slow down.

I've tried commenting out the data display part and if I simply do the SELECT with TIBCQuery, then keep looping with while not IBCQuery.Eof do IBCQuery.Next; I still get the slowness and memory problems.

I have experimented with the parameters, FetchAll is false, tried setting DeferredBlobRead to true but to no avail.

Could you recommend any other settings and variations I should try?

BTW: To me it seems that IBDAC is trying to hold the entire dataset in the memory. But is there a way to make it "forget" records that I have already fetched and displayed?

Thanks!

AndreyZ

Post by AndreyZ » Mon 19 Mar 2012 08:21

Hello,

Please check whether any memory errors occur if you don't use visual components (VirtualTreeView, etc.). You can use the following code:

Code: Select all

IBCQuery.DisableControls;
IBCQuery.FetchAll := True;
IBCQuery.Open;
If there are the "Unable to allocate memory" errors, it means that you have huge amount of data in your table. To avoid this problem, you can set the TIBCQuery.UniDirectional property to True. When UniDirectional is set to True, data is fetched on demand, but obtained rows are not cached except for the current row. Please note that UniDirectional datasets cannot be modified. You can find more information about the TIBCQuery.UniDirectional property in the IBDAC documentation.

zd
Posts: 78
Joined: Sun 01 Jul 2007 13:16

Post by zd » Wed 11 Apr 2012 09:20

Thank you for your reply, I've realized the source of the problem, see my separate thread about it please.

AndreyZ

Post by AndreyZ » Wed 11 Apr 2012 11:14


Post Reply