[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

BitmapSourceSafeMILHandle, SafeMILHandle never disposed

albertoaal

10/24/2008 9:11:00 PM

Hi,
I've been profiling a WPF application using Frame objects to navigate
between screens implemented as pages. Using two different profilers I see
that BitmapSourceSafeMILHandles are never disposed even though there are no
live references to them (that I can tell). These objects are not explicitly
created by me and by the call stacks I assume they are part of the rendering
process. The number of undisposed instances grows even if a navigate back
and forth between the same two pages.

Looking deeper at my profiling results the undisposed instances of
BitmapSourceSafeMILHandle have a variable named __gcPressure with a value of
0. That probably explains why they are never disposed. Regardless it is
strange how I could build up over a million of these guys (I set up an
automated test) without a single instance being disposed. Is this a memory
leak?

-alberto

1 Answer

v-mazho

10/27/2008 9:31:00 AM

0

Hello Alberto,

Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's
my pleasure to work with you on this thread.

This might be a leak, I've dealt with those type of issues on the MSDN WPF
forum, the most times, developers just simply forget to remove the Image
control from the visual tree, which prevents the BitmapSource image from
getting garbage collected, so usually, if the Image is removed from the
visual tree, BitmapSource is expected to be GCed.

If removing the Image from the visual tree doesn't solve the issue, I would
greatly appreciate it if you could provide a small, complete and
ready-to-run example and sent it over to me at v-mazho at microsoft dot com
for repro.

If you have any further questions on this issue, free feel to ask here, we
are glad to answer them.
--------------------------------------------------
Best regards,
Macro Zhou (v-mazho@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.