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!
Memory problems
-
AndreyZ
Hello,
Please check whether any memory errors occur if you don't use visual components (VirtualTreeView, etc.). You can use the following code: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.
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;