6

Observed behaviour (everything here is on Windows 10):

  • I run Visual Studio (tried 13 and 15, both behave the same) logged into user A
  • After starting up, VS takes virtually no CPU time (<1%)
  • I log into user B, without signing out of A
  • VS imediately starts using A LOT of CPU time (~25% on my 4 cores with hyper threading)
  • 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 any projects or files opened, though it also happens in that case.


I noticed this because I was originally investigating similar behaviour of a WPF application (after a user reported this issue).

While trying to isolate the problem, I found that even a completely new WPF project, with just a single empty window, behaves exactly the same (whether or not run through Visual Studio).

Through profiling and debugging I found that the app seems to spend a huge amount of time handling windows messages.

Specifically I found that it seems to be almost exclusively WM_PAINT messages (we are talking easily hundreds or thousands of messages per second - as many as the CPU can handle it seems).

No other programs I have running (chrome, skype, sublime text, ..) behaves this way.


Has anybody else seen this kind of behaviour? And/or any ideas what could cause this, or how I could investigate this further?

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

3
  • You can report WPF bugs at connect.microsoft.com. Be sure to include relevant machine details, particularly the DirectX version and video adapter driver version number. Meanwhile, consider minimizing the window before you switch as a temporary workaround. Commented Feb 22, 2016 at 11:15
  • Thanks @HansPassant, I'll report the problem there. I can also confirm that minimizing the window does indeed prevent the problem. Commented Feb 22, 2016 at 11:18
  • I have the same problem, but with just having Visual Studio open (doesn't even need to have a project open). Very strange. Commented Jan 21, 2017 at 19:05

1 Answer 1

0

As per Hans Passant's suggestion in the comments, I reported this problem 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 turns out this indeed seems to have been a bug in WPF, which is fixed in the current version of Windows 10 (probably specifically since the Anniversary Update (version 1607)).

Hence the solution: Make sure to update your OS.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.