Re: GC.Collect() not cleaning memory, how to find out what references to lots of memory still exist?



Calling GC.Collect is a bad idea is all but the most severe cases. In real
practice, you should not use it as it can actually impede your application's
performance.

Your best bet is to look carefully at the objects you are using and make
sure that, where appropriate, you call Dispose on them.

-Scott


"DR" <softwareengineer98037@xxxxxxxxx> wrote in message
news:uOkNbC0nIHA.2292@xxxxxxxxxxxxxxxxxxxxxxx
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() ?



.



Relevant Pages

  • Re: Short practice session
    ... the songs I have been working on lately, from memory. ... various tube amps in the basement and practice more like I am on a job. ... that time to develop new things that will stretch you, ...
    (rec.music.makers.guitar.jazz)
  • Re: Maintain list of attached event handlers (.Net 1.1)
    ... of memory is done when it is required/when it is convenient. ... That's why it is common practice to release ... tree and removes all of the handlers. ... BUT b) because I'm going to use a belt and braces approach. ...
    (microsoft.public.dotnet.framework)
  • Re: Zero Rreferences (was:Stupid Question)
    ... > drieux wrote: ... > like its not just on NT that programs retain their memory allocations. ... Think about what happens when you Perl Extension ... Folks need to remember that 'best practice' ...
    (perl.beginners)
  • Re: Article of interest: Python pros/cons for the enterprise
    ... from many articles and postings across the internet memory management ... There are other downsides to garbage collection, ... not the way it goes in practice nowadays, ...
    (comp.lang.python)
  • Re: Portable Measurement of Pointer Alignment in C?
    ... memory are not aligned on specific memory boundaries. ... control over the memory alignment of its parameters ... In other cases, even though buffer base addresses have been aligned, it may not be easy to ensure the alignment of the addresses passed to the cryptographic code since encryption may be needed on only the upper part of an allocated buffer and timing constraints may prevent realignment by copying. ... practice on the highest proportion of widely deployed processors ...
    (comp.lang.c)