GDI Leaks in 1.1 Framework sp 1

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I'm running the 1.1 FW sp 1 on XP sp 2.

I've been trying to plug leaks in our application for a month now, and
while I've reduced the memory leaked (the owned forms leak was a killer), our
power users still consistently encounter crashes from running out of GDI
handles.

I've ran the GDIUsage program from the toolkit, and I've found two bitmaps
that are being leaked for each form opened.

The first, is the form's inherant Icon. It's never being released. It
looks like http://support.microsoft.com/?id=819633 but that is for FW 1.0 sp
2. I can't find a list of what was fixed in 1.1, so I can't confirm if it's
been fixed there.

The second bitmap looks like it is partly a mask of the default icon, with
the second half being a wierd distorted grid.


Can someone tell me if this issue is fixed in 1.1 or not, and if not if
there is a hot fix?

Otherwise, I'll end up doing some really nasty reflection to trick the
system in our base class for forms to release these handles and I'd rather
avoid that hassle if possible.
 
Okay, it's been a week with no responses.

I've tried changing the icon on my base form to see if that affected what
the leaked image was, and it turns out it didn't. The bitmp leaked is still
the default app icon.

I've spinked some GC.Collect() and GC.WaitForPendingFinalizers() calls in a
few key places, and although they help clean up the stuff that wasn't leaking
forever, the leaked icons are still there.

Can't anyone at least tell me if the FW 1.0 bug I linked to below isn't
present in FW 1.1?

I've tried to recreate the leak we're experiencing in a simpler application,
but so far I haven't been able to do it.
 
Hello,

The site started erroring out for me, but I was finally able to use it
recently and I haven't found anything that seemed related.

We're using a modified version of the UIP block that we got from the
company we formerly got all of our tech from, and it's likely to still be
holding on to form references. It's possible I can still get the form
references cleaned up there and pray that these Icon's eventually get
collected. (Fortunately, reflection to clean up the OwnedForms array killed
off a huge section of our memory leaks.)

I think a huge issue, is that when I call Dispose the Form class isn't
cleaning up all of its unmanaged resources such as the smallIcon field.
AFAIK, it dumps its window's handle, but doesn't bother with the locally
copied icon. I'm not even going to attempt to see what else it isn't
bothering to clean up.

Hopefully tomorrow I'll be piloting a fix to see if doing reflection to
kill the smallIcon field when Dispose is called will cure our woes.

Thanks for the response though, that was an interesting site to look through.
 
Back
Top