Visual Studio and WPF applications: high CPU usage when logging in to another user

Observed behavior (everything here is on Windows 10):

  • I am running Visual Studio (tried 13 and 15, both behave the same) registered in user A
  • After starting, VS practically does not require processor time (<1%)
  • I log into user B without writing out A
  • VS immediately starts using A LOT of processor time (~ 25% on my 4 cores with hyperthreading)
  • I can go back and forth between A and B, and it goes back and forth between low and high CPU usage.

This is all without opening any projects or files, although this also happens in this case.


I noticed this because I initially studied a similar behavior of a WPF application (after the user reported this problem).

When I tried to isolate the problem, I found that even a completely new WPF project with a single blank window behaves the same way (regardless of whether it runs through Visual Studio).

Thanks to profiling and debugging, I found that the application seems to spend a huge amount of time processing Windows messages.

In particular, I found that it seems almost exclusively to WM_PAINT messages (we speak easily in hundreds or thousands of messages per second - as much as the processor can process).

No other programs that I run (chrome, skype, sublime text, ..) behave this way.


Has anyone else seen this behavior? And / or any ideas what might cause this, or how could I explore this further?

Naturally, I cannot fix Visual Studio (if there is a problem with my setup somehow), but I hope that I can do something with my WPF application.

+6
source share
1 answer

As suggested by Hans Passant in the comments, I reported this issue to Microsoft here:

http://connect.microsoft.com/VisualStudio/feedback/details/2390593/wpf-apps-use-a-lot-of-cpu-time-when-logged-into-different-user

As it turned out, this really was a bug in WPF, which was fixed in the current version of Windows 10 (possibly especially since the Anniversary Update (version 1607)).

Therefore, the solution: be sure to update your OS.

0
source

All Articles