 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Simon Owen Guest
|
Posted: Sun Dec 17, 2006 4:01 pm Post subject: Possible memory leak |
|
|
Hello,
I'm using IBX within BDS 2006 and have come across a rather strnage memroy
error which I can reproduce with the simple piece of code:
IBQuery1->Active = true;
while( !IBQuery1->Eof )
IBQuery1->Next();
The SQL for the query simply fetches all records from a table (about
10,000), the records themselves have quite large VARCHAR fields. When run,
the memory use of the program grows quickly until an exception "Out of
Memory" is thrown. Strangely, when I changed the components over to use
DBExpress versions, no such error occurs at all.
Was wondering if anyone else had had any problems with the IBX components in
BDS 2006. This is a bit of a show stopper for me, as I have a rather large
application thtat relies on IBX, which I daren't port from BCB5.
Thanks in advance for any help,
Simon Owen |
|
| Back to top |
|
 |
Wayne Niddery [TeamB] Guest
|
Posted: Sun Dec 17, 2006 10:46 pm Post subject: Re: Possible memory leak |
|
|
Simon Owen wrote:
| Quote: |
I'm using IBX within BDS 2006 and have come across a rather strnage
memroy error which I can reproduce with the simple piece of code:
IBQuery1->Active = true;
while( !IBQuery1->Eof )
IBQuery1->Next();
The SQL for the query simply fetches all records from a table (about
10,000), the records themselves have quite large VARCHAR fields. When
run, the memory use of the program grows quickly until an exception
"Out of Memory" is thrown. Strangely, when I changed the components
over to use DBExpress versions, no such error occurs at all.
|
That's because, by defauly, dbExpress components do no caching of the
records fetched, each time you fetch the next record, the prior one is
forgotten. By default, TIBQuery *caches* every record you fetch, so you end
up with all 10000 large records in memory. To change this, set the
UniDirectional property of the TIBQuery to True. Better yet, if you only
need to process these records in code - no dataware controls, then don't use
TIBQuery, use TIBSQL instead - it is a much simpler component (no ability to
cache) and is perfect for this kind of use.
--
Wayne Niddery - Winwright, Inc (www.winwright.ca)
Working for yourself is great because you get to work half days, and
you can choose any twelve hours you want. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|