Working with Blobs - High Memory usage

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Jank
Posts: 35
Joined: Tue 11 May 2010 11:57

Working with Blobs - High Memory usage

Post by Jank » Tue 19 Feb 2013 10:57

Hello,

i am selecting 3 colums, one is a blob, i have these settings in my tibcquery:
FetchAll = True
Options.CacheBlobs = False
Options.StreamedBlobs = True
Options.DeferredArrayRead = False
Options.CacheArrays = False

If i am not accassing the blob-col my memoryusage is fine. If i access it, the memoryusage of my application is exploding. Ok, I'm understanding that, but ther is a kind of Caching.
I access each row one time, so I don't need it after access. Is it possible, that the tibcquery releases the memory for the blob-value of the old record?

If I call the RefreshRecord-method the memoryusage is not rising, but I am not able to guarantee, that the primary key is selected. If that is not I can't use the RefreshRecord-method.

regards Jan

AndreyZ

Re: Working with Blobs - High Memory usage

Post by AndreyZ » Wed 20 Feb 2013 13:24

Hello,

You should use the following options:
StreamedBlobs = True
CacheBlobs = False
DeferredBlobRead = True
DeferredArrayRead = True
CacheArrays = False

DeferredBlobRead and DeferredArrayRead are used for fetching all BLOB and array values correspondingly when they are explicitly requested. For more information, please read the "BLOB Data Types" article in the IBDAC documentation.

Jank
Posts: 35
Joined: Tue 11 May 2010 11:57

Re: Working with Blobs - High Memory usage

Post by Jank » Thu 21 Feb 2013 16:17

Hallo Andrey,

thank you, I tried this, the result is the same, the memory-usage is growing and growing.
I've read the article and played a lot with the settings and i had every time the same result.

Regards Jan

AndreyZ

Re: Working with Blobs - High Memory usage

Post by AndreyZ » Fri 22 Feb 2013 08:41

You can set the FetchAll property to False and the UniDirectional property to True. In this case all memory of data that was read will be released automatically. Note that you cannot modify data, only read in one direction. For more information about the UniDirectional property, please refer to the IBDAC documentation.

Jank
Posts: 35
Joined: Tue 11 May 2010 11:57

Re: Working with Blobs - High Memory usage

Post by Jank » Fri 22 Feb 2013 12:13

Hi, thats what I wan't. Thank you very much.

AndreyZ

Re: Working with Blobs - High Memory usage

Post by AndreyZ » Fri 22 Feb 2013 12:19

I am glad I could help. If any other questions come up, please contact us.

Post Reply