Why does Desktop Window Manager leak memory or even crash?

My Desktop Window Manager memory usage keeps spiking and causing it to disable Aero, saying it ran out of allowed memory. DWM restarts and comes back up fine when I kill its process. Why is this happening? How can I correct it? Can I change the amount of memory it's allowed?

enter image description here

Hardware:

  • Intel Core 2 Quad / EVGA 680i mobo
  • 8GB Patriot DDR2
  • (3x) Sapphire ATI Radeon HD 4760 (multi-mon setup, not Crossfire setup)

Edit:

New system. Now on an AMD Phenom 2 1055T with 16GB DDR3. Same install of Windows 7 and same video cards (Though the new mobo, an MSI nf980-g65 also has onboard HDMI, which I'm now also using). Same exact issue.

I find it happens more often when I have browser(s) open, and when I have Seesmic (A Silverlight out-of-browser application) open.


The official unofficial explanation from Windows Engineering team on this this is that Windows is pinning GPU Accelerated applications to your primary video card. The engineering team describes it as a "very inefficienct" to use a GPU Accelerated app on a non-primary video card.

They are very dismissive of the fact that this worked for many years and now all GPU rendering applications run a high risk of taking down DWM.

They know of no fix and claim no repro despite the repro being simple. Running multiple video cards in a non-SLI/Crossfire fashion and outputing to multiple monitors. Then moving a semi-active GPU accelerated application to a non-primary video card and monitoring the shared memory GPU allocations. They will spike relative to the activty of the GPU API for the application. Simply scrolling or typing in a GPU accelerated browser (Chrome, IE, Firefox) and you may run the risk of DWM allocating more GPU Shared ram faster than it can release it.

There may be issues surrounding reproing that perhaps are a combination of a ratio of Video Card ram to System Ram, however I can verify the GPU Shared memory spikes on ANY system with multiple video card setup. Whether it takes down DWM.

DWM has a resource usage kill switch that kicks in when it exceeds a resource allocation relative to your machine. I am unsure if systems with more system RAM or systems with more GPU ram are more susceptible as quite often memory allocations are padded relative to your RAM. Start up 10 applications on 3 nearly identical systems but differing RAM amounts and you'll get different memory consumption.

Again the official unofficial response to resolve this is - there is no solution and you should not run multiple video cards in a non-SLI/Crossfire setup.

Disabling GPU Acceleration on the browser also works. IE9 is the only browser I'm aware of where disabling GPU Acceleration results in fairly decreased performance.

Of course this issue also forces one to be very careful of where you run Flash/Silverlight/Movies. On my setup it's pretty much suicide to run any of those on my 2nd video card despite it being the exact same as my primary one.


First, I assume you're running a 64 bit version of Windows, or else, most of the 8GB are useless :)

Second, I would check what have you installed lately that integrates with Windows explorer. E.g., TurtleSVN (SVN integration piece) that I've witnessed misbehave many times. Essentially, it enumerates every folder you touch in explorer, anticipating the need to integrate it with an SVN repository. And sometimes that causes slowdowns and leaks - in Windows Explorer memory space.

Third, try to find out what else loads into your explorer memory space (use Process Explorer) and eliminate the real culprit. Another thing you can do is boot into safe mode and see if the problem occurs there as well.

Fourth, do not rule out a virus or malware - check thoroughly for any of those.