Out of memory

Ruudbern

Member²
Help,

In a oracle dataset we insert thousands of records in a loop. In the taskmanager the used memory is slowly going up. On some p.c. a out of memory error occured. Any suggestions where to look at?

cachedupdates := true, commit on post False;
applyupdates is called every 100 records.

with kind regards

Ruud Bernards

with dtmimportgpocfacturatie do
begin
odtsproduct.insert;
odtsproductPRD_AANSLUITING.value:= copy(tekstregel,1,10);
odtsproductPRD_NAAM.value:= copy(tekstregel,12,35);
odtsproductPRD_ADRES.value:= copy(tekstregel,48,50);
inc(committeller);
if committeller>( teller/100 ) then
begin
dtmsession.osnAris2000.ApplyUpdates([odtsproduct],true);
committeller:=0;
end;
end;
 
I did some more research. The number of records in the dataset is related to memory used. If initialy the dataset has a few thousand records the memory jumps up when the dataset is opened (query all records) How can i reduce this?

kind regards

Ruud
 
For batch inserting of thousands of records you should preferably use a TOracleQuery and regular insert statements. For optimization purposes you could consider using Array DML, which will speed up things considerably.

------------------
Marco Kalter
Allround Automations
 
Back
Top