"Lamont Sanford" <yaBigDummy@sanford.sonwrote in message
news:dP-dnSP5rd3T9I7anZ2dnUVZ_v-hnZ2d@giganews.com...
>Therefore, I would like to know what version of the Framework and OS you
>are running this on?
>
I'm running .NET Framework 2.0 (VS 2005) on Win2003.
>
>How large are the Lists in bytes, if you say up to 100k, do you mean
>100kb or something else, how did you measure this size?
>
I just meant that the size of the list (List<T>.Count) would never exceed
100,000. If type 'T' is a double and double requires 8 bytes, the total
required memory shouldn't exceed 800,000 bytes... and I have hundreds of
gigs free.
>
No you don't? The virtual memory space attributed to your process is only
2GB (supposing W2K3 32 bit). That means that you cannot allocate more than
this space for managed objects minus the space allocated by the application
the runtime and the Framework data and code, this leaves you with less than
1.6GB (non contiguous) in the most optimal case at process creation time.
Now, 800 Kb is not a big deal, but as these objects are larger than 85Kb,
they end on the LOH and as this one is never compacted, you may end with a
highly fragmented heap, if you don't tput an eye on object life time.
>How many of these list do you possibly create simultaneously?
>
Only one can exist at a time, but these lists will be created over and
over again with different values.When a list is no longer needed, it isn't
explicitly Clear()'d, but it does fall out of scope so it should be GCd.
>
Yes, but that doesn't mean that only one can exist at a time, the GC doesn't
run deterministically.
>Are you using Sockets connections?
>
Yes, sockets are used. No more than 30 inbound connections are active at
any given time.
>
>Do you explicitly pin objects, or do you call into unmanaged code?
>
What does "pin" mean? No, I don't make any calls into unmanaged code.
Yes, you do (indirectly), there is no single managed application in the
world that don't call in unmanaged code. The socket classes need to pin the
send/reeive buffers when calling into the native Winsock API's. Pinning is
there to prevent the heap allocated object to move in memory when the GC
runs, however, pinning also prevents compactation of the GC heap.
Does it happen that these buffers have something in common with the above
mentioned List's?
Anyway, I would suggest you to inspect your memory allocation pattern by
running your code against a memory profiler.
Willy.