BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible memory leak

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express)
View previous topic :: View next topic  
Author Message
Simon Owen
Guest





PostPosted: Sun Dec 17, 2006 4:01 pm    Post subject: Possible memory leak Reply with quote



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





PostPosted: Sun Dec 17, 2006 10:46 pm    Post subject: Re: Possible memory leak Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.