G
Guest
hey doods and doodettes.
I am having severe memory issues when opening Datasets in .net 2.0. A
web-based app will cause the worker process to recycle on a heavy-duty server
after just a few client connections, and a windows app will bring the machine
to a crawl. My testing code is as follows. It is used as the source for a
report that can obviously be run many times. Even if I isolate the code to
just opening and closing the data (as shown below), major problems still
occur. Have I left anything out?
using (SqlDataAdapter TheAdapter = new SqlDataAdapter("select * from
customermaster", DoodConnection))
{
using (DataSet TheCustomers = new DataSet())
{
TheCustomers.Tables.Add("CustomerMaster");
TheAdapter.Fill(TheCustomers, "CustomerMaster");
TheAdapter.Dispose();
TheCustomers.Dispose();
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
The "using" was added based on a post I found but did not help at all.
Adding calls to GC helped a bit, but in the long run this is ridiculous!!!
I am having severe memory issues when opening Datasets in .net 2.0. A
web-based app will cause the worker process to recycle on a heavy-duty server
after just a few client connections, and a windows app will bring the machine
to a crawl. My testing code is as follows. It is used as the source for a
report that can obviously be run many times. Even if I isolate the code to
just opening and closing the data (as shown below), major problems still
occur. Have I left anything out?
using (SqlDataAdapter TheAdapter = new SqlDataAdapter("select * from
customermaster", DoodConnection))
{
using (DataSet TheCustomers = new DataSet())
{
TheCustomers.Tables.Add("CustomerMaster");
TheAdapter.Fill(TheCustomers, "CustomerMaster");
TheAdapter.Dispose();
TheCustomers.Dispose();
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
The "using" was added based on a post I found but did not help at all.
Adding calls to GC helped a bit, but in the long run this is ridiculous!!!