From: "Stoitcho Goutsev \(100\) [C# MVP]" <
[email protected]>
References: <#
[email protected]> <
[email protected]> <Ow$ysU8fEHA.2812 @tk2msftngp13.phx.gbl>
Subject: Re: Understanding the Garbage Collector
Date: Wed, 11 Aug 2004 15:54:00 -0400
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <#
[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: 207.219.70.165
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:265208
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
Hi MFRASER,
It is possible that GC may not do its job correctly. For example if you have
small object that allocates huge amount of unmanaged memory GC won't kick
in. because from its point of view everything is ok. Hoever the memory is
not enough. When you call GC.Collect it might execute some finalizers, which
clear that unmanaged memory and from this point on everything goes smoothly
again.
You might don't know but some classes use internally unmanaged memory (AFAIK
Region nad MenuItem(?!?) are such classes)
In .NET 2.0 GC class introduces new method that lets us add some pressure to
the memory
--
HTH
Stoitcho Goutsev (100) [C# MVP]
MFRASER said:
Except that I see the following. When I run my application it builds a Heap
to a size of 200+ meg, and when the heap is at this level the entire system
is at a crawl. When I execute the System.GC.Collect the memory drops back
to 30 meg and has a reasonable response time. If I do not execute the
System.GC.Collect the memory is never retrieved by the system. Based on
this it seams to me that the GC is not doing its job.
Thanks
that reference