Board index » delphi » Delphi / BDE Memory Leak?

Delphi / BDE Memory Leak?

I am using Delphi 4 C/S with update batch 3, BDE 5.1.1 and Oracle 8.1.5 for
database. In my program I have a simple method that upload data to the
database by using a stored procedure, and passing the fields to be updated
through a TStoredprocedure component. I explicitly prepare the stored
procedure by calling the prepare method, prior to using it the first time,
and unprepare when I am finished. The following is a simple diagram of what
my method look like

1- Prepare Stored Procedure
2- loop
3- Call stored procedure
4- go to step 2 until all the data is moved to the database
5- Unprepare the stored procedure

There are approximately 1,000,000 records that I am uploading. As I watch
the task manager in windows NT, I notice that I loose 16 bytes after every
10 records get uploaded, and eventually my program crashes because I am out
of memory.
Is there a document memory leak in either Delphi or the BDE that I should be
aware of. Has anybody ran across the same problem and if so, what kind of
work around can be implemented.

Any Help is greatly Appreciated
Maher AL-Rijleh

 

Re:Delphi / BDE Memory Leak?


From the 5.11 BDEReadme.txt for Oracle 8 issues

"A memory leakage may occur when executing a query many
times. Workaround: call DbiQFree() and DbiQPrepare() every
time the query is executed."

Quote
Maher Al-Rijleh wrote:

> I am using Delphi 4 C/S with update batch 3, BDE 5.1.1 and Oracle 8.1.5 for
> database.
> Is there a document memory leak in either Delphi or the BDE that I should be
> aware of. Has anybody ran across the same problem and if so, what kind of
> work around can be implemented.

> Any Help is greatly Appreciated
> Maher AL-Rijleh

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
Maybe it was infatuation or the thrill of the chase.
Maybe you were always beyond my reach and my heart was playing safe.
But was that love in your eye I saw or the reflection of mine?
Give me time, won't you give me that time!
Welcome back to the circus.            (Fish)

Re:Delphi / BDE Memory Leak?


Thanks

Jeff Overcash (TeamB) <overc...@onramp.net> wrote in message
news:38F12051.EACEC22@onramp.net...

Quote
> From the 5.11 BDEReadme.txt for Oracle 8 issues

> "A memory leakage may occur when executing a query many
> times. Workaround: call DbiQFree() and DbiQPrepare() every
> time the query is executed."

> Maher Al-Rijleh wrote:

> > I am using Delphi 4 C/S with update batch 3, BDE 5.1.1 and Oracle 8.1.5
for
> > database.

> > Is there a document memory leak in either Delphi or the BDE that I
should be
> > aware of. Has anybody ran across the same problem and if so, what kind
of
> > work around can be implemented.

> > Any Help is greatly Appreciated
> > Maher AL-Rijleh

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> Maybe it was infatuation or the thrill of the chase.
> Maybe you were always beyond my reach and my heart was playing safe.
> But was that love in your eye I saw or the reflection of mine?
> Give me time, won't you give me that time!
> Welcome back to the circus.            (Fish)

Re:Delphi / BDE Memory Leak?


Is anybody there, who tried this workaround?

Using Delphi it is not enough to call TQuery.Prepare
/ TQuery.Close every time the query is executed.

Using TQuery.Prepare / TQuery.Unprepare every time
means to dispense with prepared queries.

Maybe I have do do something else? Looking at

...
 i:=0;
 with QPrep do
  begin
   SQL.clear;
   SQL.Add('select * from Prep where ID=:Param1');
   Prepare;
   while  true do
    begin
     Close;
     ParamByName('Param1').AsInteger:=i;
     inc(i);
     Open;
    end;
 end;//with
... (don't look at the semantics)

what is the solution / how should DbiQFree()
and DbiQPrepare() integrated in???

Torsten Ripke

In article <38F12051.EACE...@onramp.net>,
  "Jeff Overcash (TeamB)" <overc...@onramp.net> wrote:

Quote
> From the 5.11 BDEReadme.txt for Oracle 8 issues

> "A memory leakage may occur when executing a query many
> times. Workaround: call DbiQFree() and DbiQPrepare() every
> time the query is executed."

Sent via Deja.com http://www.deja.com/
Before you buy.

Other Threads