Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF DropShadowEffect and Blur memory leaks

I'm writing an app, which is essentially a bunch of loose xaml screens - no codebehind, just dynamically linked to a ViewModel at runtime.

When running this over a weekend on an older pc, there was a crash. Tracing and recreating showed there was a memory leak in igdumd32.dll (An intel graphics driver dll). After a bit of investigation I wrote 2 simple standalone apps with a very simple animation in centre screen. 1 with no effects and 1 with a dropshadoweffect on the animation - no other changes, literally a 1 line change to the first app (xaml is quite verbose, otherwise I'd post it here). I ran these through redgate's memory profiler tool for 40 minutes. The 1st one was fine: enter image description here but the 2nd one had a notable memory leak on igdumd32.dll and memory allocated by managed code:enter image description here

Another thing I noticed is that this doesn't happen on a new pc. Looking at the versions of igdumd32.dll - the older pc has a 2009 version (8.15.10.1930) whereas the newer (working) pc has the 2012 version (8.15.10.2639).

Has anyone else experienced this? My thoughts are to only use special effects in xaml when the chipsets/drivers can handle this, but I can't find anything on the web or on MSDN that tells me hardware or driver limitations for these effects (beyond telling me that Hardware Acceleration is required for them or my CPU will bump up).

like image 302
El Mariachi Avatar asked Dec 09 '13 11:12

El Mariachi


1 Answers

Your DropShadow and Blur effects in the earlier iterations of WPF were implemented in software (within WPF itself, that is) and would probably not have that problem of leaking memory. Later (4.0 and up) changed the syntax slightly and added the ability to off-load these effects to the graphics hardware. While that does enhance the execution-speed, it also becomes dependent upon the graphics driver to avoid leaking memory. You can change your code to implement these in WPF itself, or as you already have -- provide a hard-coded look-see to the graphics driver.

like image 131
JamesWHurst Avatar answered Oct 10 '22 17:10

JamesWHurst