Getblob Memory Leak issue?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Getblob Memory Leak issue?

Post by jdredd » Wed 07 Jul 2010 15:28

I have a routine that uploads 130k+ images to a table, using Toratable.


for x:=0 to filelist.count-1 do
begin
oraTable1.Append;
oratable1.fields[1].asstring:=extractfilename(ChangeFileExt(filelist[x], ''));
oratable1.getblob('imageblob').LoadFromFile(filelist[x]);
oratable1.post;
end;

After a while this bloats up to over 2gb of mem used.

If i remove the getblob line, it runs fine.

This is using v6.90.0.58 in D2007

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Wed 07 Jul 2010 15:43

Hello

Please specify what connection are you using: OCI or Direct?

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Post by jdredd » Wed 07 Jul 2010 15:46

Sorry about that.

Direct.

The OraTable1, I just dropped it on the form, did not change any settings.

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Post by jdredd » Wed 07 Jul 2010 21:09

Possible Solution?

for x:=0 to filelist.count-1 do
begin
oraTable1.Append;
oratable1.fields[1].asstring:=extractfilename(ChangeFileExt(filelist[x], ''));
oratable1.getblob('imageblob').LoadFromFile(filelist[x]);
oratable1.post;
oratable1.getblob('imageblob').release;
end;

after running this for a while my mem usage stayed around ~20mb. Remove the release and with in just a matter of a few minutes its over 200mb.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 08 Jul 2010 08:10

Hello

Thank you for the information. We have reproduced your issue. We will notify you as soon as we have any result.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 08 Jul 2010 10:07

All inserted records are stored in the DataSet until it will be closed. To release used memory you should close your TOraTable.

If you want to stop growth of memory usage you can modify your code:

Code: Select all

  OraTable1.Close;
  OraTable1.UniDirectional := True;
  OraTable1.Options.DeferredLobRead := True;
  OraTable1.Open;

  for x:=0 to filelist.count-1 do
  begin
    oraTable1.Append;
    oratable1.fields[1].asstring:=extractfilename(ChangeFileExt(filelist[x], ''));
    oratable1.getblob('imageblob').LoadFromFile(filelist[x]);
    oratable1.post;

    if x mod 10 = 9 then
    begin
      OraTable1.Close;
      OraTable1.Open;
    end;
  end;

  OraTable1.Close;

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Post by jdredd » Thu 08 Jul 2010 14:01

bork wrote:All inserted records are stored in the DataSet until it will be closed. To release used memory you should close your TOraTable.

If you want to stop growth of memory usage you can modify your code:

Code: Select all

  OraTable1.Close;
  OraTable1.UniDirectional := True;
  OraTable1.Options.DeferredLobRead := True;
  OraTable1.Open;

  for x:=0 to filelist.count-1 do
  begin
    oraTable1.Append;
    oratable1.fields[1].asstring:=extractfilename(ChangeFileExt(filelist[x], ''));
    oratable1.getblob('imageblob').LoadFromFile(filelist[x]);
    oratable1.post;

    if x mod 10 = 9 then
    begin
      OraTable1.Close;
      OraTable1.Open;
    end;
  end;

  OraTable1.Close;
thanks ill give it a whirl.

Post Reply