WPF Storyboard animations leak unmanaged memory - by Chris Frolik

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


4
0
Sign in
to vote
ID 338723 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 4/17/2008 11:48:26 AM
Access Restriction Public

Description

WPF Storyboard animations leak unmanaged memory if they are created in a process which has had Dispatcher frames that have previously been launched and exited.  Once a storyboard has begun via BeginAnimation, the process will continue to leak unmanaged memory at a steady rate until it exits.
Sign in to post a comment.
Posted by ambrauer on 3/11/2010 at 6:54 AM
I've encountered the same exact issue. Since upgrading to .NET 4.0 is not an option for us at this time, I found a workaround here:
http://stackoverflow.com/questions/1705849/wpf-memory-leak-on-xp-cmilchannel-hwnd

Adding this line:
new HwndSource(new HwndSourceParameters());
to the Application constructor seems to fix this memory leak, as well as another one we have noticed with TextBoxes.
Posted by FX Team on 3/15/2009 at 9:25 AM
Can please provide a hotfix for this? My customer is very disappointed with the performance issue currently. Thanks much.
Posted by kflim1 on 3/12/2009 at 8:26 PM
Is there any patches after installed .NET Framework 3.5 SP 1? When will .NET Framework 4.0 release? As I'm having this issue whereby using heavy animations and run 24 hours x 7 days. It caused memory kept increasing although I forced garbage collector to collect. Please advice.
Posted by Dwayne [MSFT] on 3/9/2009 at 2:10 PM
Thanks for reporting this problem. We have fixed this issue, which will be available in the 4.0 release.
Posted by dm01 on 4/21/2008 at 7:00 AM
I have further analyzed my posted problem under 1. comment (2008-04-18 - 15:46) :

After upgrade my machine with " .NET-Framework 3.0 SP1 " this memoryleak also occurs.
It seems to me, that it is a problem of .NET-Release and not of VS2008-release

My .NET3.0 Framework components after upgrade to .NET-Framework 3.0 SP1:
milcore.dll 6.0.6001.17014 (lh_tools_devdiv_wpf.071009-1109)    09.10.2007 21:36
mscoree.dll 2.0.50727.1433 (REDBITS.050727-1400)     24.10.2007 09:35
msvcr80.dll    8.00.50727.1433        24.10.2007 05:02
PresentationCore.dll    3.0.6920.1109 (lh_tools_devdiv_wpf.071009-1109)     09.10.2007 20:33


Posted by dm01 on 4/18/2008 at 3:46 PM
I have discovered a similar problem.

- WpfApp compiled with .NET-Framework 3.0 under VS2005(+WPF)
- using some Storyboard-Animation initiated on load and later on MouseOver-event
- program runs fine without any leak on XP-SP2 with .NET-Framework 3.0

- running the same (.NET3.0-compiled code) on another system !!! WITH VS2008 installed !!! a resource leak occurs:
- we found several continuous allocations of small HeapAlloc()-blocks with size 68 bytes
- callstack could be located from "milcore.dll"
- after removing storyboard-animations from our WpfApp, the memleak doesn't occur on the VS2008-system.

Frameworkversions on well running system (.NET 3.0)

milcore.dll     6.0.5840.16386 (vista_rtm_wcp.061020-1904)     21.10.2006 05:43
mscoree.dll    2.0.50727.832 (QFE.050727-8300)             13.04.2007 09:13
msvcr80.dll    8.00.50727.762                     02.12.2006 08:50
PresentationCore.dll 3.0.6920.0 (vista_rtm_wcp.061020-1904)      21.10.2006 05:07


Frameworkversions on leaked system (.NET 3.0 after VS2008-Installation)

milcore.dll    6.0.6001.17014 (lh_tools_devdiv_wpf.071009-1109)    09.10.2007 21:36
mscoree.dll    2.0.50727.1433 (REDBITS.050727-1400)            24.10.2007 09:35
msvcr80.dll    8.00.50727.1433                        24.10.2007 05:02
PresentationCore.dll 3.0.6920.1109 (lh_tools_devdiv_wpf.071009-1109)    09.10.2007 20:33

Posted by Microsoft on 4/18/2008 at 12:06 AM
Thanks for your feedback. We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team