RE: Slow performance with garbage collection

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Chris Lyon [MSFT] (clyon_at_online.microsoft.com)
Date: 01/10/05


Date: Mon, 10 Jan 2005 19:55:10 GMT

Hi Milan

The .NET runtime will not choose server GC unless explicitly told you. There are two ways to do this:
1. add <GCSERVER enabled="true" /> to your application's config file (available in .NET 1.1 SP1)
2. create an unmanaged host for your app and select Server GC there.

Further reading:
http://weblogs.asp.net/clyon/archive/2004/09/08/226981.aspx
http://weblogs.asp.net/clyon/archive/2004/09/10/228104.aspx

Hope that helps
-Chris

--------------------

>
>Just wondering if someone can help me with a problem with garbage collection
>that I seem to have:
>
>I have a client/server system where the clients are experiencing quite long
>delays because of bad performance on the server. The server uses Windows
>Server 2003 with the .NET v1.1 Service Pack 1 update. I have used the
>Performance utility on the server during these bad performance periods and
>have noticed that there is a lot of time spent in the garbage collection.
>
>Does anyone know why this might be?
>
>***
>More detail:
>The nature of our system involves a lot of large objects (85KB+) being used
>and the large object heap size reflects this. There also seems to be a lot
>of garbage collection happening in the large object heap which I feel maybe
>our problem. If the average size of one of our objects is larger than the
>Generation 2 threshold (which it could easily be if the threshold is around
>10MB) then as soon as our object is on the heap then it will result in a
>garbage collection. This means that everytime one of our large objects goes
>on the heap, there is a corresponding garbage collection (this is just guess
>work though)...that would make an awful lot of garbage collections going on.
>
>I have read up about the issue with mscorwks.dll being used for garbage
>collection on a multiprocessor server. Typing in "tasklist /m mscorwks.dll"
>brings a list of our applications running under this DLL.
>
>The server I have is dual proccesor, thus I installed the .NET v1.1. SP1 to
>update the config settings so mscorsvr.dll would be used instead and enable
>the multiprocessor garbage collection. This has not made any noticeable
>difference with performance. However, typing in the above command still
>indicated our applications were running under the mscorwks.dll.
>
>I have also tried the gcConcurrent setting as well and this has not made any
>difference either.
>***
>
>It would be much appreciated if anyone can help with this problem?
>
>Thanks
>
>Milan
>
>
>

-- 
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at 
http://www.microsoft.com/info/cpyright.htm 
Note:  For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.  


Relevant Pages

  • Re: I have seen some fat client Dot Net apps
    ... Garbage collection does not seem to be that great for a busy server app, ... built by people who don't know the platform or how to design software, ... understand the platform deeply and are very good at designing software. ...
    (borland.public.delphi.non-technical)
  • Re: Slow performance with garbage collection
    ... > The .NET runtime will not choose server GC unless explicitly told you. ... >>have noticed that there is a lot of time spent in the garbage collection. ... >>and the large object heap size reflects this. ... >>update the config settings so mscorsvr.dll would be used instead and ...
    (microsoft.public.dotnet.framework)
  • Slow performance with garbage collection
    ... Just wondering if someone can help me with a problem with garbage collection ... I have a client/server system where the clients are experiencing quite long ... The server uses Windows ... and the large object heap size reflects this. ...
    (microsoft.public.dotnet.framework)
  • Re: [PHP] Persistence of session files
    ... ; on every session initialization. ... The probability is calculated by using gc_probability/gc_divisor, ... cleaned up by the garbage collection process. ... On a busy server, this means that garbage will be thrown out ...
    (php.general)
  • Re: Delphi Users - BCBers need you...
    ... > and a garbage collection started, which pretty much stalled the server. ... > The machine was forcibly reset after a few hours, the GC process making ...
    (borland.public.delphi.non-technical)