PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist?
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist?
![]() |
GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
GC.Collect() not cleaning memory, how to find out what references to lots of
memory still exist? When all my processign is done i set everything to null and then: GC.Collect(); and then GC.WaitForPendingFinalizers(); but it still shows that my process takes 400 MB of memory. Is there any easy way to see what references that I forgot to set to null so that the memory cleas up on GC.Collect() ? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
If you're running CF 3.5 you can use the profiler, which is part of the
Remote Performance Monitor. -- Chris Tacke, Embedded MVP OpenNETCF Consulting Giving back to the embedded community http://community.OpenNETCF.com "DR" <softwareengineer98037@yahoo.com> wrote in message news:OZA93D0nIHA.2292@TK2MSFTNGP03.phx.gbl... > GC.Collect() not cleaning memory, how to find out what references to lots > of memory still exist? > > When all my processign is done i set everything to null and then: > GC.Collect(); > and then > GC.WaitForPendingFinalizers(); > but it still shows that my process takes 400 MB of memory. Is there any > easy way to see what references that I forgot to set to null so that the > memory cleas up on GC.Collect() ? > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
If you are using CF 2 like I do, you can retarget your application to
run on the full framework and then use the Profiler for the full framework. Besides, I think that setting all the references to null is not enough... you should call Dispose() where it is requiered (i.e. Bitmaps). On 15 abr, 19:20, "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> wrote: > If you're running CF 3.5 you can use the profiler, which is part of the > Remote Performance Monitor. > > -- > > Chris Tacke, Embedded MVP > OpenNETCF Consulting > Giving back to the embedded communityhttp://community.OpenNETCF.com > > "DR" <softwareengineer98...@yahoo.com> wrote in message > > news:OZA93D0nIHA.2292@TK2MSFTNGP03.phx.gbl...> GC.Collect() not cleaning memory, how to find out what references to lots > > of memory still exist? > > > When all my processign is done i set everything to null and then: > > GC.Collect(); > > and then > > GC.WaitForPendingFinalizers(); > > but it still shows that my process takes 400 MB of memory. Is there any > > easy way to see what references that I forgot to set to null so that the > > memory cleas up on GC.Collect() ? |
|
|
|
#4 |
|
Guest
Posts: n/a
|
It is always bad design to call the garbage collector to explicitly clean up.
-- Simon Hart Visual Developer - Device Application Development MVP http://simonrhart.blogspot.com "DR" wrote: > GC.Collect() not cleaning memory, how to find out what references to lots of > memory still exist? > > When all my processign is done i set everything to null and then: > GC.Collect(); > and then > GC.WaitForPendingFinalizers(); > but it still shows that my process takes 400 MB of memory. Is there any easy > way to see what references that I forgot to set to null so that the memory > cleas up on GC.Collect() ? > > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
I wouldn't go that far. "Always" is too strong a statement. It is rarely
good design, but not *always* bad. -- Chris Tacke, Embedded MVP OpenNETCF Consulting Giving back to the embedded community http://community.OpenNETCF.com "Simon Hart [MVP]" <srhartone@yahoo.com> wrote in message news:62E6D9EF-BE7A-45C0-8C07-CA573B0A0848@microsoft.com... > It is always bad design to call the garbage collector to explicitly clean > up. > -- > Simon Hart > Visual Developer - Device Application Development MVP > http://simonrhart.blogspot.com > > > "DR" wrote: > >> GC.Collect() not cleaning memory, how to find out what references to lots >> of >> memory still exist? >> >> When all my processign is done i set everything to null and then: >> GC.Collect(); >> and then >> GC.WaitForPendingFinalizers(); >> but it still shows that my process takes 400 MB of memory. Is there any >> easy >> way to see what references that I forgot to set to null so that the >> memory >> cleas up on GC.Collect() ? >> >> >> |
|
|
|
#6 |
|
Guest
Posts: n/a
|
That's a fair comment.
-- Simon Hart Visual Developer - Device Application Development MVP http://simonrhart.blogspot.com "Chris Tacke, eMVP" wrote: > I wouldn't go that far. "Always" is too strong a statement. It is rarely > good design, but not *always* bad. > > > -- > > Chris Tacke, Embedded MVP > OpenNETCF Consulting > Giving back to the embedded community > http://community.OpenNETCF.com > > "Simon Hart [MVP]" <srhartone@yahoo.com> wrote in message > news:62E6D9EF-BE7A-45C0-8C07-CA573B0A0848@microsoft.com... > > It is always bad design to call the garbage collector to explicitly clean > > up. > > -- > > Simon Hart > > Visual Developer - Device Application Development MVP > > http://simonrhart.blogspot.com > > > > > > "DR" wrote: > > > >> GC.Collect() not cleaning memory, how to find out what references to lots > >> of > >> memory still exist? > >> > >> When all my processign is done i set everything to null and then: > >> GC.Collect(); > >> and then > >> GC.WaitForPendingFinalizers(); > >> but it still shows that my process takes 400 MB of memory. Is there any > >> easy > >> way to see what references that I forgot to set to null so that the > >> memory > >> cleas up on GC.Collect() ? > >> > >> > >> > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

