> > Analysis:
> > #1 indicates that a memory leak is occuring rather than the GC simply
[quoted text clipped - 4 lines]
> time to really be able to tell what all the various data points in the
> profiler were.
Indeed. I'm still trying to understand what that tool is showing me. I
was hoping for a leak in a 3rd party OEM dll, but rather than having a
leak in blah.dll (OEM to remain nameless), I had an 80 MB difference
in the OTHER category.
> > #2 indicates that the leak is occuring in unmanaged code rather than
> > managed code (according to several other ng posts).
[quoted text clipped - 4 lines]
> description of the problem see:
> http://blogs.msdn.com/yunjin/archive/2004/01/27/63642.aspx
Awesome, I love getting responses to my questions :)
We're not doing any pinning, the data that is being passed from the
managed world into the unmanaged world to be processed is essentially
always unmanaged memory, it's in fact memory that even NT doesn't see.
The managed world just holds a OEM-specific handle to memory that our
imaging library understands, then we pass the raw pointer into UC++,
this doesn't require a __pin.
> The solution that we ended up using was very similar to what Yun talks about
> in that blog. We create a large pool of objects (in our case, we allocate
> 10,000 instances of a 2K byte array) at application startup, and we then
> check these objects in and out of the pool over time. The pool grows in
> 10,000 object increments as needed. This eliminated the memory fragmentation
> that we were seeing by calling into unmanaged code.
I thought it was UC++ fragmentation at first as well, but now that I'm
not doing any allocations in UC++ I'm doubting that.
> Something else to try - in terms of narrowing down if it's a manged or
> unmanged leak - when you look at the GC performance counters as your
[quoted text clipped - 4 lines]
> steady state in terms of memory consumption, this should help pin things
> down.
I appear to have lost 40 MB in Gen #2 over a 12 hour period.. thats
based on data from SciTech, but whats confusing is that perfmon shows
# of bytes in all heaps remaining in the 5-10 MB range throughout.
On a somewhat related note,
Any links to GOOD explanations of all the perfmon counters?
-ken
Chris Mullins - 20 Aug 2004 21:20 GMT
"Ken Durden" <creepiecrawlies@hotmail.com> wrote in message
> I appear to have lost 40 MB in Gen #2 over a 12 hour period.. thats
> based on data from SciTech, but whats confusing is that perfmon shows
> # of bytes in all heaps remaining in the 5-10 MB range throughout.
In terms of finding usefull things with SciTech, it just took many hours of
staring. I do remember the "age" column, in the instance section, was able
to help me quite a bit. I found groups of related objects all of the same
age, and that clued me in as to what was staying around.
Unfortunatly there was no way to have the profiler sort by Age.
Something that I thought about doing - the SciTech guys would probably
accept some $$ to look at your heap dumps and tell you where the problems
are.
If not them, then DevelopMentor (with Richter, Robbins, et al) provides a
debugging service that is fairly reasonably priced.
> On a somewhat related note,
> Any links to GOOD explanations of all the perfmon counters?
Just the stuff in MSDN.
The counter that I found most usefull was the "Gen 2 heap size" counter. It
got to the point where that was the only counter I was even looking at.

Signature
Chris Mullins