OracleDataset allocates too much memory

PaulIsh

Member
Every time when I opene dataset with 2,7 millions records I get out of memory exception. I look to sources and find such strings
...
MaxRecords := Count div 2;
if MaxRecords < DataSet.ReadBuffer + 1 then
MaxRecords := DataSet.ReadBuffer + 1;
...

Please insert this lines beween assignment and condition in order to make your component works with big amount of data.

if MaxRecords > 256000 then
MaxRecords := 256000;

Sorry, for my bad english.
 
You should never populate a dataset with 2.7 million records. If you want to process all these records, use a TOracleQuery or set TOracleDataSet.UniDirectional to True. If you need just a subset of these 2.7 million records, use an appropriate where clause.
 
But what should I do if I need work with TDataset class. I create custom datasets in connection library (dll) and it can be interbase dataset, ado, bde and other. I work with them as with TDataset class. At the begining of operation I dont know how big will be result set. And of course 2,7 million records is not usual case for application.

Please, if you inclide lines that I post previously you components would'not be more slowly, be they would be more stable.
 
In that case you can set TOracleDataSet.UniDirectional to True. I assume that you are not actually moving back and forth in a 2.7 million record dataset.
 
Back
Top