Page 1 of 1
Getblob Memory Leak issue?
Posted: Wed 07 Jul 2010 15:28
by jdredd
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
Posted: Wed 07 Jul 2010 15:43
by bork
Hello
Please specify what connection are you using: OCI or Direct?
Posted: Wed 07 Jul 2010 15:46
by jdredd
Sorry about that.
Direct.
The OraTable1, I just dropped it on the form, did not change any settings.
Posted: Wed 07 Jul 2010 21:09
by jdredd
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.
Posted: Thu 08 Jul 2010 08:10
by bork
Hello
Thank you for the information. We have reproduced your issue. We will notify you as soon as we have any result.
Posted: Thu 08 Jul 2010 10:07
by bork
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;
Posted: Thu 08 Jul 2010 14:01
by jdredd
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.