Select the product you need help with
FIX: Memory leak occurs in a WPF application when a brush object is referenced by using a DynamicResource referenceArticle ID: 2651992 - View products that this article applies to. On This PageSYMPTOMSConsider the following scenario:
In this scenario, instances are rooted in the garbage-collected (GC) heap and not are released. Over time, a memory leak occurs as more and more instances of the window or of the user control are created. Eventually, you receive a System.OutOfMemoryException exception. Note This issue does not occur when the application targets the Microsoft .NET Framework 4. CAUSEThis issue occurs because the WPF run-time wires an internal event handler to the ResourceReferenceExpression object that is associated with the resource that the window or the user control is using. This event handler reference is not removed when the window or the user control is closed and set to null. RESOLUTIONHotfix informationA supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website: http://support.microsoft.com/contactus/?ws=support Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
(http://support.microsoft.com/contactus/?ws=support)
PrerequisitesTo apply this hotfix, you must have the Microsoft .NET Framework 3.5.1 installed on a computer that is running one of the following operating systems:
Restart requirementYou must restart the computer after you apply this hotfix if the affected files are being used.File informationThe global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.For all supported x86-based versions of Windows 7 Collapse this table
For all supported x64-based versions of Windows 7 and of Windows Server 2008 R2 Collapse this table
WORKAROUNDTo work around this issue, use one of the following methods:
REFERENCESFor more information about the DynamicResource markup extension, visit the following MSDN website: General information about the DynamicResource markup extension For more information about WPF brushes, visit the following MSDN website:
(http://msdn.microsoft.com/en-us/library/ms748942(v=VS.90).aspx)
General information about WPF brushes
(http://msdn.microsoft.com/en-us/library/aa970904(v=VS.90).aspx)
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. PropertiesArticle ID: 2651992 - Last Review: January 16, 2012 - Revision: 2.0 APPLIES TO
| Article Translations
|


Back to the top








