Page 1 of 1

out of memory when posting to Tvirtualtable

Posted: Mon 10 Sep 2007 07:47
by jeantawk
Hello
I have a Delphi application for processing reports from an Oracle database.
After I get well into the report (about 2000 rows), I run out of memory. The application works like this:

if VDataSetRows.Count > 0 then
begin
for i := 2 to VDataSetRows.Count - 1 do
begin
AVirtualTable.Append ;
VDataSetRow := TDataSetRow(VDataSetRows.Items ) ;
for j := 0 to VDataSetRow.DataSetFields.Count - 1 do
begin
VDataSetField := TDataSetField( VDataSetRow.DataSetFields.Items[j] ) ;


VFindField := AVirtualTable.FieldByName( VDataSetField.FieldName ) ;
if VFindField NIL then
begin
if VFindField.DataType = ftFloat then
VFindField.AsFloat :=
else if VFindField.DataType = ftInteger then
VFindField.AsInteger :=
else if VFindField.DataType = ftBoolean then
VFindField.AsBoolean :=
else
VFindField.AsString :=
end ;
end ;
AVirtualTable.Post ;
end ;
if VDataSetRows.Count > 2 then
AVirtualTable.First ;
end ;


I have 1 gigabyte of ram on my desktop machine, so I should not be running out of memory.
Does anybody know what I should be doing, what I should be closing, or where I should be freeing something to conserve this memory?
By the way , i used the TClientDataSet instead of TVirtualTable for a test and everything went OK.
Any ideas ?

Posted: Tue 11 Sep 2007 11:19
by Antaeus
It is pretty hard to determine what is the reason of the problem having only this piece of code. Try to make a small sample to reproduce this problem. Send me this sample at evgeniyd*crlab*com.
Also supply me the following information:
- exact version of TVirtualTable.
- exact version of your IDE.