phunv
asked on
Free up memory used by a dataset
The code:
DataSet ds = new DataSet();
OleDbAdapter da = new OleDbAdapter(sqltext, connection);
da.Fil(ds, "foo");
the command text is a select command retrieving lots of data. After that call the memory jumps up (by more than 100M).
Then I try to clean up the dataset by:
ds.Tables["foo"].Clear();
ds.Dispose();
ds = null;
But the memory decreases by only a fraction of the above (about 10-20M).
What's wrong with the code, how can I free up the memory used by the dataset.
Thannks.
DataSet ds = new DataSet();
OleDbAdapter da = new OleDbAdapter(sqltext, connection);
da.Fil(ds, "foo");
the command text is a select command retrieving lots of data. After that call the memory jumps up (by more than 100M).
Then I try to clean up the dataset by:
ds.Tables["foo"].Clear();
ds.Dispose();
ds = null;
But the memory decreases by only a fraction of the above (about 10-20M).
What's wrong with the code, how can I free up the memory used by the dataset.
Thannks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DataSet ds = new DataSet();
OleDbAdapter da = new OleDbAdapter(sqltext, connection);
da.Fil(ds, "foo");
the command text is a select command retrieving lots of data. After that call the memory jumps up (by more than 100M).
Then I try to clean up the dataset by:
ds.Tables["foo"].Clear();
ds.Dispose();
ds = null;
GC.Collect();
Good Luck,
VINHNL
OleDbAdapter da = new OleDbAdapter(sqltext, connection);
da.Fil(ds, "foo");
the command text is a select command retrieving lots of data. After that call the memory jumps up (by more than 100M).
Then I try to clean up the dataset by:
ds.Tables["foo"].Clear();
ds.Dispose();
ds = null;
GC.Collect();
Good Luck,
VINHNL
http://www.developersdex.com/vb/message.asp?p=1121&r=4406289
S Sansanwal