Hello -

I've developed an application which uses DataSets which are local to
specific methods - so they should go out of scope when the form they are on
is closed. I am finding that while monitoring the memory usage through task
manager, the memory will increase while the dataset is filled, but memory is
never released when the form is closed. Even when using the Dispose() method
of the DataSet, as well as explicitly calling GC.Collect() and
GC.WaitForPendingFinalizers(). After searching the web for hourse, I cannot
find anyone who can solve this problem. Does anyone know how to fix this?

Thanks,

-Peter

Re: DataSet not releasing memory by Miha

Miha
Tue Jun 28 02:27:13 CDT 2005

Hi Fith,

I don't think that Task Manager is a proper tool for monitoring memory
usage.
Instead, try one of the memory profilers - there are free ones:

Allocation Profiler
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=36A3E666-6877-4C26-B62D-BFD7CB3154AC
Devpartner Community edition
http://www.compuware.com/products/devpartner/profiler/default.asp?cid=3019X36&focus=DevPartner&source=Web+%2D+Evaluation+Request&desc=Download+%2D+%27DevPartner+Profiler+Community+Edition%27&offering=DevPartner&sf=1&p=0

and commercial ones:
AQTime
http://www.automatedqa.com/products/aqtime/index.asp
.NET Memory Profiler
http://www.scitech.se/memprofiler/

And others...

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Fith" <Fith@discussions.microsoft.com> wrote in message
news:EFA1B9FC-4FA4-4C40-911D-8773A7ECBD75@microsoft.com...
> Hello -
>
> I've developed an application which uses DataSets which are local to
> specific methods - so they should go out of scope when the form they are
> on
> is closed. I am finding that while monitoring the memory usage through
> task
> manager, the memory will increase while the dataset is filled, but memory
> is
> never released when the form is closed. Even when using the Dispose()
> method
> of the DataSet, as well as explicitly calling GC.Collect() and
> GC.WaitForPendingFinalizers(). After searching the web for hourse, I
> cannot
> find anyone who can solve this problem. Does anyone know how to fix this?
>
> Thanks,
>
> -Peter



Re: DataSet not releasing memory by Cor

Cor
Tue Jun 28 05:06:07 CDT 2005

Fith,

This is the thirth time that I sent this link of this message in 24 hours.
The first one I sent it to was impressed by it. It is from Willy.

http://groups-beta.google.com/group/microsoft.public.dotnet.general/msg/392a8e932c39983d?hl=en

I hope this helps,

Cor



Re: DataSet not releasing memory by Fith

Fith
Tue Jun 28 08:39:03 CDT 2005

I've heard other people say that the 'Mem Usage' is not an accurate view of
the memory usage, but I don't buy that - my application runs increasingly
more slowly every time the DataSet is filled (the task manager's 'Mem Usage'
increases) until the application is virtually unusable. Also, other tasks on
the computer are affected (run slow) at this point. Once I close my
application, all response returns to normal. The memory is definitely being
allocated and not returned, no matter what people say about task manager not
being an accurate measure of memory usage...

I need to know if someone has any knowledge of this issue with DataSet
memory not being released.

Thanks all,

-Peter

"Miha Markic [MVP C#]" wrote:

> Hi Fith,
>
> I don't think that Task Manager is a proper tool for monitoring memory
> usage.
> Instead, try one of the memory profilers - there are free ones:
>
> Allocation Profiler
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=36A3E666-6877-4C26-B62D-BFD7CB3154AC
> Devpartner Community edition
> http://www.compuware.com/products/devpartner/profiler/default.asp?cid=3019X36&focus=DevPartner&source=Web+%2D+Evaluation+Request&desc=Download+%2D+%27DevPartner+Profiler+Community+Edition%27&offering=DevPartner&sf=1&p=0
>
> and commercial ones:
> AQTime
> http://www.automatedqa.com/products/aqtime/index.asp
> ..NET Memory Profiler
> http://www.scitech.se/memprofiler/
>
> And others...
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
> SLODUG - Slovene Developer Users Group www.codezone-si.info
>
> "Fith" <Fith@discussions.microsoft.com> wrote in message
> news:EFA1B9FC-4FA4-4C40-911D-8773A7ECBD75@microsoft.com...
> > Hello -
> >
> > I've developed an application which uses DataSets which are local to
> > specific methods - so they should go out of scope when the form they are
> > on
> > is closed. I am finding that while monitoring the memory usage through
> > task
> > manager, the memory will increase while the dataset is filled, but memory
> > is
> > never released when the form is closed. Even when using the Dispose()
> > method
> > of the DataSet, as well as explicitly calling GC.Collect() and
> > GC.WaitForPendingFinalizers(). After searching the web for hourse, I
> > cannot
> > find anyone who can solve this problem. Does anyone know how to fix this?
> >
> > Thanks,
> >
> > -Peter
>
>
>

Re: DataSet not releasing memory by Miha

Miha
Tue Jun 28 09:39:04 CDT 2005

Hi,

I really doubt that DataSet is the culprit.
Why don't you profile your app using one of the mentioned profiles instead
to find the reason?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Fith" <Fith@discussions.microsoft.com> wrote in message
news:56AFB82F-5490-4F08-B9B0-13E2BC226098@microsoft.com...
> I've heard other people say that the 'Mem Usage' is not an accurate view
> of
> the memory usage, but I don't buy that - my application runs increasingly
> more slowly every time the DataSet is filled (the task manager's 'Mem
> Usage'
> increases) until the application is virtually unusable. Also, other tasks
> on
> the computer are affected (run slow) at this point. Once I close my
> application, all response returns to normal. The memory is definitely
> being
> allocated and not returned, no matter what people say about task manager
> not
> being an accurate measure of memory usage...
>
> I need to know if someone has any knowledge of this issue with DataSet
> memory not being released.
>
> Thanks all,
>
> -Peter
>
> "Miha Markic [MVP C#]" wrote:
>
>> Hi Fith,
>>
>> I don't think that Task Manager is a proper tool for monitoring memory
>> usage.
>> Instead, try one of the memory profilers - there are free ones:
>>
>> Allocation Profiler
>> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=36A3E666-6877-4C26-B62D-BFD7CB3154AC
>> Devpartner Community edition
>> http://www.compuware.com/products/devpartner/profiler/default.asp?cid=3019X36&focus=DevPartner&source=Web+%2D+Evaluation+Request&desc=Download+%2D+%27DevPartner+Profiler+Community+Edition%27&offering=DevPartner&sf=1&p=0
>>
>> and commercial ones:
>> AQTime
>> http://www.automatedqa.com/products/aqtime/index.asp
>> ..NET Memory Profiler
>> http://www.scitech.se/memprofiler/
>>
>> And others...
>>
>> --
>> Miha Markic [MVP C#] - RightHand .NET consulting & development
>> www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>> SLODUG - Slovene Developer Users Group www.codezone-si.info
>>
>> "Fith" <Fith@discussions.microsoft.com> wrote in message
>> news:EFA1B9FC-4FA4-4C40-911D-8773A7ECBD75@microsoft.com...
>> > Hello -
>> >
>> > I've developed an application which uses DataSets which are local to
>> > specific methods - so they should go out of scope when the form they
>> > are
>> > on
>> > is closed. I am finding that while monitoring the memory usage through
>> > task
>> > manager, the memory will increase while the dataset is filled, but
>> > memory
>> > is
>> > never released when the form is closed. Even when using the Dispose()
>> > method
>> > of the DataSet, as well as explicitly calling GC.Collect() and
>> > GC.WaitForPendingFinalizers(). After searching the web for hourse, I
>> > cannot
>> > find anyone who can solve this problem. Does anyone know how to fix
>> > this?
>> >
>> > Thanks,
>> >
>> > -Peter
>>
>>
>>



Re: DataSet not releasing memory by Cor

Cor
Tue Jun 28 09:52:33 CDT 2005

Fith,

Not any problem, try this

*Disclaimer this is not a sample how to do things*
Sub AddDataset (byval ds as dataset)
static ar as arraylist
ar.add(ds)
End sub

You will see your memory grow and your dataset will not be released, how
many time you try to dispose it or how many time you call the GC. It is just
the way of (wrong) code that does this. Can it be that withouth that you
know have something like this (not this code, like this code) in your
program.

As long as there is a reference to an object than it will not be released.

I hope this helps,

Cor



Re: DataSet not releasing memory by Fith

Fith
Tue Jun 28 10:59:01 CDT 2005

Miha -

I don't want to use the profiler yet, as it looks like it would take a weeks
worth of study just to figure out how to use and interpret it... I don't
have that kind of time.

Anyway, I found that minimizing my app seems to bring the memory reading in
taskmanager way down as well - so it isn't the dataset. I'd like to find out
why this behavior takes place as well now...

-Peter

"Miha Markic [MVP C#]" wrote:

> Hi,
>
> I really doubt that DataSet is the culprit.
> Why don't you profile your app using one of the mentioned profiles instead
> to find the reason?
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
> SLODUG - Slovene Developer Users Group www.codezone-si.info
>
> "Fith" <Fith@discussions.microsoft.com> wrote in message
> news:56AFB82F-5490-4F08-B9B0-13E2BC226098@microsoft.com...
> > I've heard other people say that the 'Mem Usage' is not an accurate view
> > of
> > the memory usage, but I don't buy that - my application runs increasingly
> > more slowly every time the DataSet is filled (the task manager's 'Mem
> > Usage'
> > increases) until the application is virtually unusable. Also, other tasks
> > on
> > the computer are affected (run slow) at this point. Once I close my
> > application, all response returns to normal. The memory is definitely
> > being
> > allocated and not returned, no matter what people say about task manager
> > not
> > being an accurate measure of memory usage...
> >
> > I need to know if someone has any knowledge of this issue with DataSet
> > memory not being released.
> >
> > Thanks all,
> >
> > -Peter
> >
> > "Miha Markic [MVP C#]" wrote:
> >
> >> Hi Fith,
> >>
> >> I don't think that Task Manager is a proper tool for monitoring memory
> >> usage.
> >> Instead, try one of the memory profilers - there are free ones:
> >>
> >> Allocation Profiler
> >> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=36A3E666-6877-4C26-B62D-BFD7CB3154AC
> >> Devpartner Community edition
> >> http://www.compuware.com/products/devpartner/profiler/default.asp?cid=3019X36&focus=DevPartner&source=Web+%2D+Evaluation+Request&desc=Download+%2D+%27DevPartner+Profiler+Community+Edition%27&offering=DevPartner&sf=1&p=0
> >>
> >> and commercial ones:
> >> AQTime
> >> http://www.automatedqa.com/products/aqtime/index.asp
> >> ..NET Memory Profiler
> >> http://www.scitech.se/memprofiler/
> >>
> >> And others...
> >>
> >> --
> >> Miha Markic [MVP C#] - RightHand .NET consulting & development
> >> www.rthand.com
> >> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
> >> SLODUG - Slovene Developer Users Group www.codezone-si.info
> >>
> >> "Fith" <Fith@discussions.microsoft.com> wrote in message
> >> news:EFA1B9FC-4FA4-4C40-911D-8773A7ECBD75@microsoft.com...
> >> > Hello -
> >> >
> >> > I've developed an application which uses DataSets which are local to
> >> > specific methods - so they should go out of scope when the form they
> >> > are
> >> > on
> >> > is closed. I am finding that while monitoring the memory usage through
> >> > task
> >> > manager, the memory will increase while the dataset is filled, but
> >> > memory
> >> > is
> >> > never released when the form is closed. Even when using the Dispose()
> >> > method
> >> > of the DataSet, as well as explicitly calling GC.Collect() and
> >> > GC.WaitForPendingFinalizers(). After searching the web for hourse, I
> >> > cannot
> >> > find anyone who can solve this problem. Does anyone know how to fix
> >> > this?
> >> >
> >> > Thanks,
> >> >
> >> > -Peter
> >>
> >>
> >>
>
>
>

Re: DataSet not releasing memory by Miha

Miha
Tue Jun 28 13:01:58 CDT 2005

Hi Fith,

As I've mentioned before, Task Manager is not the right place to look at
memory usage for .net applications.
The .net memory management is a bit complex and you'll have to read some
articles to understand it.
The golden rule is to Dispose every class that implements IDisposable.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Fith" <Fith@discussions.microsoft.com> wrote in message
news:87237F93-7FEB-43D9-866A-00A332949549@microsoft.com...
> Miha -
>
> I don't want to use the profiler yet, as it looks like it would take a
> weeks
> worth of study just to figure out how to use and interpret it... I don't
> have that kind of time.
>
> Anyway, I found that minimizing my app seems to bring the memory reading
> in
> taskmanager way down as well - so it isn't the dataset. I'd like to find
> out
> why this behavior takes place as well now...
>
> -Peter
>
> "Miha Markic [MVP C#]" wrote:
>
>> Hi,
>>
>> I really doubt that DataSet is the culprit.
>> Why don't you profile your app using one of the mentioned profiles
>> instead
>> to find the reason?
>>
>> --
>> Miha Markic [MVP C#] - RightHand .NET consulting & development
>> www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>> SLODUG - Slovene Developer Users Group www.codezone-si.info
>>
>> "Fith" <Fith@discussions.microsoft.com> wrote in message
>> news:56AFB82F-5490-4F08-B9B0-13E2BC226098@microsoft.com...
>> > I've heard other people say that the 'Mem Usage' is not an accurate
>> > view
>> > of
>> > the memory usage, but I don't buy that - my application runs
>> > increasingly
>> > more slowly every time the DataSet is filled (the task manager's 'Mem
>> > Usage'
>> > increases) until the application is virtually unusable. Also, other
>> > tasks
>> > on
>> > the computer are affected (run slow) at this point. Once I close my
>> > application, all response returns to normal. The memory is definitely
>> > being
>> > allocated and not returned, no matter what people say about task
>> > manager
>> > not
>> > being an accurate measure of memory usage...
>> >
>> > I need to know if someone has any knowledge of this issue with DataSet
>> > memory not being released.
>> >
>> > Thanks all,
>> >
>> > -Peter
>> >
>> > "Miha Markic [MVP C#]" wrote:
>> >
>> >> Hi Fith,
>> >>
>> >> I don't think that Task Manager is a proper tool for monitoring memory
>> >> usage.
>> >> Instead, try one of the memory profilers - there are free ones:
>> >>
>> >> Allocation Profiler
>> >> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=36A3E666-6877-4C26-B62D-BFD7CB3154AC
>> >> Devpartner Community edition
>> >> http://www.compuware.com/products/devpartner/profiler/default.asp?cid=3019X36&focus=DevPartner&source=Web+%2D+Evaluation+Request&desc=Download+%2D+%27DevPartner+Profiler+Community+Edition%27&offering=DevPartner&sf=1&p=0
>> >>
>> >> and commercial ones:
>> >> AQTime
>> >> http://www.automatedqa.com/products/aqtime/index.asp
>> >> ..NET Memory Profiler
>> >> http://www.scitech.se/memprofiler/
>> >>
>> >> And others...
>> >>
>> >> --
>> >> Miha Markic [MVP C#] - RightHand .NET consulting & development
>> >> www.rthand.com
>> >> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>> >> SLODUG - Slovene Developer Users Group www.codezone-si.info
>> >>
>> >> "Fith" <Fith@discussions.microsoft.com> wrote in message
>> >> news:EFA1B9FC-4FA4-4C40-911D-8773A7ECBD75@microsoft.com...
>> >> > Hello -
>> >> >
>> >> > I've developed an application which uses DataSets which are local to
>> >> > specific methods - so they should go out of scope when the form they
>> >> > are
>> >> > on
>> >> > is closed. I am finding that while monitoring the memory usage
>> >> > through
>> >> > task
>> >> > manager, the memory will increase while the dataset is filled, but
>> >> > memory
>> >> > is
>> >> > never released when the form is closed. Even when using the
>> >> > Dispose()
>> >> > method
>> >> > of the DataSet, as well as explicitly calling GC.Collect() and
>> >> > GC.WaitForPendingFinalizers(). After searching the web for hourse,
>> >> > I
>> >> > cannot
>> >> > find anyone who can solve this problem. Does anyone know how to fix
>> >> > this?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > -Peter
>> >>
>> >>
>> >>
>>
>>
>>



Re: DataSet not releasing memory by amir

amir
Wed Jun 29 02:00:13 CDT 2005

Hello Fith,

Could you please try GC.ReRegisterForFinalize(yourDataSet) right after you
are done with your DataSet?

Thanks
Amir


--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.



"Fith" <Fith@discussions.microsoft.com> wrote in message
news:EFA1B9FC-4FA4-4C40-911D-8773A7ECBD75@microsoft.com...
> Hello -
>
> I've developed an application which uses DataSets which are local to
> specific methods - so they should go out of scope when the form they are
> on
> is closed. I am finding that while monitoring the memory usage through
> task
> manager, the memory will increase while the dataset is filled, but memory
> is
> never released when the form is closed. Even when using the Dispose()
> method
> of the DataSet, as well as explicitly calling GC.Collect() and
> GC.WaitForPendingFinalizers(). After searching the web for hourse, I
> cannot
> find anyone who can solve this problem. Does anyone know how to fix this?
>
> Thanks,
>
> -Peter