Re: Memory leak
- From: john sun <jsunnewsgroup@xxxxxxxxx>
- Date: Mon, 01 Jan 2007 12:27:26 -0500
Frank Rizzo wrote:
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.
Have you tried to use the process explorer, http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx
There is a column called private bytes, and you can use that column to track how many memory your application is really using.
The mem usage column used by the task manager is the actual working set size of the process, it includes the shared memory and all the memory used by a lot of system resource. In the .Net case, it includes the memory used by the framework.
HTH.
J.W.
.
- Prev by Date: Re: DAtagrid for Flat File
- Next by Date: Re: .NET mix C# with vb.NET
- Previous by thread: Re: Memory leak
- Next by thread: Re: Memory leak
- Index(es):
Relevant Pages
|