PC Review


Reply
Thread Tools Rate Thread

DataSet not releasing memory

 
 
=?Utf-8?B?Rml0aA==?=
Guest
Posts: n/a
 
      27th Jun 2005
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
 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      28th Jun 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/U...D-BFD7CB3154AC
Devpartner Community edition
http://www.compuware.com/products/de...rtner&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" <(E-Mail Removed)> wrote in message
news:EFA1B9FC-4FA4-4C40-911D-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      28th Jun 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/...2c39983d?hl=en

I hope this helps,

Cor


 
Reply With Quote
 
=?Utf-8?B?Rml0aA==?=
Guest
Posts: n/a
 
      28th Jun 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/U...D-BFD7CB3154AC
> Devpartner Community edition
> http://www.compuware.com/products/de...rtner&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" <(E-Mail Removed)> wrote in message
> news:EFA1B9FC-4FA4-4C40-911D-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      28th Jun 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" <(E-Mail Removed)> wrote in message
news:56AFB82F-5490-4F08-B9B0-(E-Mail Removed)...
> 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/U...D-BFD7CB3154AC
>> Devpartner Community edition
>> http://www.compuware.com/products/de...rtner&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" <(E-Mail Removed)> wrote in message
>> news:EFA1B9FC-4FA4-4C40-911D-(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      28th Jun 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


 
Reply With Quote
 
=?Utf-8?B?Rml0aA==?=
Guest
Posts: n/a
 
      28th Jun 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" <(E-Mail Removed)> wrote in message
> news:56AFB82F-5490-4F08-B9B0-(E-Mail Removed)...
> > 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/U...D-BFD7CB3154AC
> >> Devpartner Community edition
> >> http://www.compuware.com/products/de...rtner&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" <(E-Mail Removed)> wrote in message
> >> news:EFA1B9FC-4FA4-4C40-911D-(E-Mail Removed)...
> >> > 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
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      28th Jun 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" <(E-Mail Removed)> wrote in message
news:87237F93-7FEB-43D9-866A-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:56AFB82F-5490-4F08-B9B0-(E-Mail Removed)...
>> > 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/U...D-BFD7CB3154AC
>> >> Devpartner Community edition
>> >> http://www.compuware.com/products/de...rtner&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" <(E-Mail Removed)> wrote in message
>> >> news:EFA1B9FC-4FA4-4C40-911D-(E-Mail Removed)...
>> >> > 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
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
amir massourian
Guest
Posts: n/a
 
      29th Jun 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" <(E-Mail Removed)> wrote in message
news:EFA1B9FC-4FA4-4C40-911D-(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Releasing Memory. =?Utf-8?B?VERhdmVQ?= Windows XP Internet Explorer 2 8th Nov 2005 09:47 PM
DataSet object not releasing memory Mark Rae Microsoft ADO .NET 6 17th Feb 2005 07:23 AM
DataSet object not releasing memory Mark Rae Microsoft VB .NET 5 15th Feb 2005 09:43 AM
ASP.net NOT Releasing Memory M.Ob Microsoft ASP .NET 2 10th Jun 2004 01:15 PM
MDI Child Form Not Releasing DataSet Mark Olbert Microsoft Dot NET Framework Forms 1 10th Sep 2003 03:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:01 AM.