Growing Working Set Size on GUI App

From: MS support (anonymous_at_discussions.microsoft.com)
Date: 02/27/04


Date: Fri, 27 Feb 2004 08:24:56 -0800

I suggest using the CLR profiler to instrument your
application. There may be a leak, a static holding on to
more data than you think for example. Based on what you
describe, GC is doing its job but it find more and more
data that is live. The CLR profiler can give take
snapshots of the heap at various time and will display the
delta between snapshots, allowing you to find our which
objects get more numerous as time goes.
I hope this helps
Patrick
>-----Original Message-----
>I know there have been a lot of posts in relation to GC,
working set,
>trimming working sets, minimizing forms, etc. I've read
every one I can
>find, but have not found a solution to my problem. The
closest I ever found
>was the thread here recently "GC does not release
memory... memory keeps
>growing".
>
>We have a GUI app on a client site, which is being used
under Citrix by up
>to ~100 users at a time. For some reason, the working set
size of the
>processes continues to grow, even though the managed heap
is maintained at a
>small level. This leads to around 6GB of allocated memory
on their system,
>which is causing memory to be paged out en mass, which is
slowing the
>machine down a lot.
>
>We see similar behaviour on our own machines with just
one copy, eg a test
>we ran (Taking around 20 minutes) finished with a working
set of around
>240MB (which started around 30MB), and only 13MB in the
managed heap. All
>our forms use managed code, there aren't any unmanaged
resources directly
>allocated by us.
>
>When we saw garbage collections happening, the working
set size would drop,
>but not always back to what it had been previously. This
was most pronounced
>when there had been a large amount of allocation between
clearings of the
>heap. In one case, one form allocates around 50MB on the
heap, then it
>closes and the memory is GC'd out of the heap. The
working set reduced in
>size after this, but it was significantly higher than it
had been before the
>form was opened.
>
>We tried this hotfix
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;833610 (Programs
>that use the .NET Framework may experience a high memory
condition) from the
>other thread, but it didn't seem to have any effect. Is
there a list
>somewhere of hotfixes that apply to 1.1 of the Framework?
>
>I realise that we can trim the working set, either with
an API call or by
>minimizing the form. However, as I have read in several
places, as far as I
>understand, all this does is take pages of memory out of
the actively used
>set, so they are now eligable to be pushed out to disk in
the page file.
>There is plenty of paging happening already, and this is
actually a problem,
>because the paging is slow, and hence our app is running
slowly. What I am
>wondering is how we are going from startup, with ~3MB
managed heap, 35MB
>working set to ~13MB managed heap, 240MB working set.
>
>Any help you could give would be greatly appreciated.
>
>Thanks,
>
>Niall
>
>
>.
>



Relevant Pages

  • Re: Whats the difference between the heap and the freestore?
    ... >> In general, when discussing dynamically allocated memory, I hear people ... As of a couple of days ago, I though the heap ... > When you use the term heap in the context of memory allocation it annoys ... > without saying that they have to be allocated on a stack or anything else. ...
    (comp.lang.cpp)
  • Memory problems - WinDbg and SOS: Who recognizes this pattern?
    ... Last night I managed to get a memory dump using ADPlus and I analyzed it ... ephemeral segment allocation context: none ... Large object heap starts at 0x0a0d0030 ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Tip Required on Dynamic Memory Allocation in Server Applications ...
    ... a memory allocation failure after 300 usages of the string ... Suggestions where given to pre-reserve the size of the heap, ... My program works untill 200-300 requests are ...
    (microsoft.public.win32.programmer.kernel)
  • Re: C++ Garbage Collector on VMS?
    ... case of a reference counting system, have a non-zero reference count) as ... to the beginning of the heap, updating the pointers to the objects as it ... (segregating allocation areas by type/size can help a lot there, ... any way with GC-controlled memory). ...
    (comp.os.vms)
  • Re: Wonder why GC has only 2 generations ... here is the answer.
    ... > native allocation, and can help your application improve performance. ... > The GC maintains a list of roots, which point into the GC heap. ... of moving large areas of memory outweighs the amount of memory that would be ...
    (microsoft.public.dotnet.faqs)

Loading