we know about them) pinned objects are in SSPI.
We try analyze heap's dumps from WinDbg (specially fragmented parts).
HANDLE(Strong):9d2b04:Root:0xc2eef8(System.Net.Sockets.OverlappedAsyncResult)->0x4d3dc20(System.AsyncCallback)->0x4d3dbc0(System.Runtime.Remoting.Channels.Tcp.TcpServerSocketHandler)->0x23f39b7c(System.Byte[])
It's always "after" free space in heap. Any idea?
"Willy Denoyette [MVP]" wrote:
>
> "Josef Dvorak" <JosefDvorak@discussions.microsoft.com> wrote in message
> news:66BB2031-5EB1-4444-BBE9-EBABBF456310@microsoft.com...
> > Hi,
> > I'm Marek Cvrk's colleague and we made some first measurement.
> > At server side we used "server settings" for Garbage Collector (element
> > <gcServer enabled="true"/> in config file - that sets to server type of
> > GC)
> > and the server runnig on Windows 2000 Server OS and has 3GB of RAM.
> >
> > With these settings service get OutOfMemory exception after some time of
> > runnig. The counter Private Bytes shows value abou 1,2GB.
> > So we try to delete element <gcServer> from config file (that sets to
> > workstation type of GC) and it works. But why? Any idea? (The counter
> > Private Bytes shows value about 600MB).
> >
> > We also made memory dump of server with server GC (when Private Bytes
> > shows
> > about 1,2GB; we use WinDbg) and it's look like memory fragmentation. (You
> > can
> > find it on
www.josef-dvorak.webzdarma.cz/dump2003_20050919.txt). At this
> > dump
> > you can see (almost at the end) that there is about 1GB of free memory.
> > But
> > in some cases it failed on OutOfMemoryException and in other cases memory
> > is
> > released (and it falls to 400MB (starting memory consuption of "clear"
> > service) and proces of memory consumption will start again...). Any idea
> > how
> > to prevent fragmentation?
> > There is no fragmentation with "workstation" GC.
> >
> > We also read discussion about GC problems on W2k server with 2GB RAM or
> > more...
> > but nobody (at that discussion) confirmed that.
> >
> > Thanks
> > Josef Dvorak
> >
>
> There is not anough info in the dumps to pin-point the problem, however here
> is what I see in the dump:
>
> First you start with two large free memory area's (plus some smaller area's)
> 1. 11022000 -> 51a70000 = ~1GB
> 2. 51af0000 -> 61e50000 = ~ 260MB
>
> The reason for this is (partly):
> ModLoad: 51a70000 51af0000
> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\diasymreader.dll
> Note that this DLL is badly mapped, it's a debugging helper DLL, are you
> sure this is a release build?
>
> You are running the server GC on a dual proc, that means you have two GC
> heaps (one per processor), however, I don't see where they are allocated nor
> what size they have.
> Anyway, 959,716,812 is taken by the generational heaps (total), from which
> 953,434,664 is free, I don't see any large objects in the dump, so I'm not
> sure your problem is related to the regular heap or the LOH.
> The last part of the dump shows the fragmentation of the GC heap (the
> 953,434,664 free part), this is an indication that you are allocating
> pinned objects combined with an high allocation rate.
> Here is what I think is happening; when you run the Server GC , chances are
> that your socket related code runs on one and the same single CPU (the CPU
> handling the socket IO and APC stuff, the OS likes to keep this on the same
> CPU if possible), so socket data will be stored on one and the same GC heap.
> Socket data is pinned for the duration of the call to the (unmanaged)
> Winsock library and if you don't take care the buffer might stay pinned for
> a much longer time. When you run the WKS GC, you have one single heap shared
> by both CPU's, the amount of fragmentation will probably be the same, but
> the GC is more agressive, so he collects more often , the result being a
> larger heap and more free space (larger free block).
> Conclusion: check your socket data allocation and pinning, check the # of
> pinned objects using perfmon and try to minimize them.
>
> Willy.
>
>
>
>
>
>
>
>
>