FIX: "Insufficient memory to continue the execution of the program" error when you run a .NET Framework 4–based WPF application that uses the InteropBitmap class


Consider the following scenario:
  • You run a Microsoft .NET Framework 4–based Windows Presentation Foundation (WPF) application that uses the InteropBitmap class to render a bitmap.
  • The application uses a hardware-rendering mode.
  • The application invalidates the bitmap at a fast speed.
In this scenario, the memory usage of the application increases to a high value. After several minutes, a System.OutOfMemoryException exception may be generated, and you receive the following error message:
Insufficient memory to continue the execution of the program.


This issue occurs because the application creates a new bitmap cache on every invalidation update instead of updating the existing cache.

When the application invalidates the bitmap at a fast speed, memory resources may be exhausted, and then the exception occurs. 


Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

To resolve this problem immediately, 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: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.


To apply this hotfix, you must have the Microsoft .NET Framework 4 installed. 

Restart requirement

You must restart the computer after you apply this hotfix if the affected files are being used. 

We recommend that you exit all .NET Framework applications before you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

File information

The English 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 version of Windows XP, of Windows Server 2003, of Windows Vista, of Windows Server 2008, and of Windows 7
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll4.0.30319.4503,789,15201-Apr- 201112:26x86
Presentationframework.dll4.0.30319.4506,431,08001-Apr- 201112:26x86
Windowsbase.dll4.0.30319.4501,371,48001-Apr- 201112:26x86
Wpfgfx_v0400.dll4.0.30319.4501,663,32001-Apr- 201112:26x86
For all supported x64-based version of Windows XP, of Windows Server 2003, of Windows Vista, of Windows Server 2008, of Windows 7, and of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
Presentationcore.dll4.0.30319.4503,824,99201-Apr- 201118:52x64
Presentationframework.dll4.0.30319.4506,431,08001-Apr- 201112:26x64
Windowsbase.dll4.0.30319.4501,371,48001-Apr- 201112:26x64
Wpfgfx_v0400.dll4.0.30319.4502,153,81601-Apr- 201118:52x64


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Identyfikator artykułu: 2494124 — ostatni przegląd: 24.05.2011 — zmiana: 1