Enumerate what was collected by the GC?

M

mark r.

Hi, all:

I know it's strongly recommended against, but I believe my application runs
much more smoothly if I call GC.Collect() in a worker loop. If I omit the
call, I get an OutOfMemoryException from Graphics.DrawImage() halfway
through.

The loop in question is creating, resizing, and drawing a number of Bitmap
resources (which are unmanaged in C# but wrapped by a managed class). I
assume the exception stems from something I've somewhere neglected to
Dispose() of, but I really can't seem to locate it.

Are there any good trace or debug utilities for profiling the
behind-the-scenes activity of the GC? Maybe a way to track whose finalizers
are being called? I posted a few weeks back asking about a way to iterate
the referenced object list but heard no reply...

Thank you for any and all help.

/m
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top