What is the cost of memory for a DataSet and other .Net Collection classes?

In our modern, but not very modern n-level application, we actively use DataSets, and we evaluate the change to other lighter objects (i.e. collections of typed objects).

Is there any background document on how much we can get in memory consumption by doing this?

+5
source share
2 answers

The heavy memory hitters for a DataSet are the DataRow object needed for each row in the DataTable and the index that is automatically generated for each column. Storing column values ​​is efficient; you cannot improve it. Replacing this with a collection of shared collections will eliminate DataRows, which can be a gross 50% savings if there are not many columns in the DataTable.

Indexes are what you need to worry about. They make queries in the DataSet very quickly, you will lose this if you do not provide some kind of custom substitute. If you need to provide a replacement, it is impossible to say, it depends on the type of requests that you run.

+3
source

, . , DataSet , , , , .

, , DataSet ( : , DataViews?, ?) .

, , DataSets, .

0

All Articles