Unexplained items in dotMemory's Automatic Inspections for a WPF C# application

The Automatic Inspection found some mistakes I made, but after fixing those, here are some internal Windows things I appear to have no control over:

Finalizable objects

NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteFont>
NativePointerWrapper<MS::Internal::Text::TextInterface::Native::DWRITE_SCRIPT_ANALYSIS>
NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteNumberSubstitution>
NativeIUnknownWrapper<MS::Internal::Text::TextInterface::Native::IDWriteFontList>
SafeRegistryHandle

Event handlers leak

TextServicesContext+TextServicesContextShutDownListener
WeakEventTable+WeakEventTableShutDownListener
Data.DataBindEngine+DataBindEngineShutDownListener
ManagedWndProcTracker+ManagedWndProcTrackerShutDownListener

 

Are these real issues, and if so, how can I make them go away?

 

 

1
4 comments
Official comment

Hi, Bruce
It seems that these problems appear in the WPF subsystem itself and not caused by wrong usage of them by your code. It is clearly seen on the "Key Retentions Path" view that, for example, WeakEventTable+WeakEventTableShutDownListener  is hold in memory by instances of AppDomain and Dispatcher classes which are deep core WPF and System components. The rest of potential problems found by "Event handlers leak" inspections look the same. I'm afraid you can't change it and due to they don't waste any significant amount of memory I'll recommend to ignore them.
Problems found by "Finalizable objects" inspection seems to be from this category also.



Hello Bruce,

Sure, you can't change system classes, but you can try to avoid using the classes with an issue if they significantly affect performance of your application or just ignore inspection notification if you can't do it or your app works properly with it.

 

0

Anna,

 

I'm using Visual Studio. When I search my entire solution for these classes, such as "TextServicesContext" and "WeakEventTable", they are not found.

 

Is there a good way to find what is causing these leak-causing classes, short of rebuilding my application piece by piece until they appear?

 

Thanks,

 

Bruce

0

Ed,

 

Thank you for the additional information about AppDomain and Dispatcher classes being deep core WPF and System components through the Key Retention Paths view.

 

That saved me time trying to find them and the other similar issues.

 

Bruce

 

0

Please sign in to leave a comment.