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
Getblob Memory Leak issue?
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.
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.
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:
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.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;