F
Frank Rizzo
Hello, I have a very frustrating issue I've been working on. I have a
routine that does the following:
1. Load a large (declared local to the function) DataSet from the
database. It contains 5 tables.
2. Load the database into a fairly complicated object model.
3. I dispose of the Dataset.
Before loading the DataSet the MemUsage column in Task Manager shows 44
MB. After loading the database the MemUsage stands at 59 MB. Thus I
assume that the DataSet has about 15 MB of data, which is about right.
I then load the DataSet data into an object model and the MemUsage jumps
to 84 MB, thus the object model weighs about 25 MB, which is also about
right.
I then dispose of the DataSet, but the MemUsage column does not change.
I've tried GC.Collect, GC.WaitForPendingFinalizers, DataSet.Clear,
etc... but nothing helps.
Why won't the DataSet release memory? There is a definite leak of 15
MB, which wouldn't be a problem, except that this routine is run by
multiple threads, which multiplies the problem quite a bit.
This is VS2003 and .NET 1.1. I've found a discussion where a claim is
made by someone else that DataSet doesn't release memory, but nothing
specific is offered (
http://www.dotnet247.com/247reference/msgs/35/178959.aspx ). Any
guidance on this subject would be appreciated.
Regards.
routine that does the following:
1. Load a large (declared local to the function) DataSet from the
database. It contains 5 tables.
2. Load the database into a fairly complicated object model.
3. I dispose of the Dataset.
Before loading the DataSet the MemUsage column in Task Manager shows 44
MB. After loading the database the MemUsage stands at 59 MB. Thus I
assume that the DataSet has about 15 MB of data, which is about right.
I then load the DataSet data into an object model and the MemUsage jumps
to 84 MB, thus the object model weighs about 25 MB, which is also about
right.
I then dispose of the DataSet, but the MemUsage column does not change.
I've tried GC.Collect, GC.WaitForPendingFinalizers, DataSet.Clear,
etc... but nothing helps.
Why won't the DataSet release memory? There is a definite leak of 15
MB, which wouldn't be a problem, except that this routine is run by
multiple threads, which multiplies the problem quite a bit.
This is VS2003 and .NET 1.1. I've found a discussion where a claim is
made by someone else that DataSet doesn't release memory, but nothing
specific is offered (
http://www.dotnet247.com/247reference/msgs/35/178959.aspx ). Any
guidance on this subject would be appreciated.
Regards.