I noticed that string grid is consuming huge amount of memory. I have like 15 000 rows and 30 cols with strings which I`m loading from DB.
qry_->DisableControls();
qry_->Prepare();
qry_->Open("SELECT * FROM FILES ORDER BY CP_CODE,REC_DATE,REC_TIME ASC");
qry_->FetchAll();
qry_->First();
TDataFields dataFields; ;
dataFields.SetQuery(qry_);
try
{
grid_->RowCount = qry_->RecordCount + 1;
grid_->BeginUpdate();
int i = 1;
while (!qry_->Eof)
{
updateGridCells(dataFields, i);
qry_->Next();
i++;
}
}
finally
{
grid->EndUpdate();
qry->EnableControls();
qry_->Close();
}
14 800 records are consuming around 2GB ram which stays occupied even after clearing the grid with grid_->Clear();
Any ideas what would cause this problem ?
Regards!
Regards!