Why does the editor keep freezing, especially when I alt tab?

Working on my home computer, I’ve noticed that the Unity Editor has a tendency to lock up while the game is running, particularly when it loses focus (I alt-tab, a breakpoint is hit in Visual Studio, etc). It becomes entirely non-responsive (no matter how long I let it sit), and the task manager says it’s stuck at 25% processor usage. The only thing I can do is forcibly end the process, which sucks for iteration time.

Specifically, the game needs to be actively playing. If I pause it, set a breakpoint, and step, there are no problems. I also don’t have any problems resuming. But as soon as I alt-tab out (either intentionally, or because of a breakpoint), then by the time I’ve given the editor focus again, it’s frozen. It will very rarely do this even if it has focus and I’m playing the game, alt-tabbing just guarantees it happens.

This is not an issue of infinite loops (already checked thoroughly for that), nor is it a case of infinite recursion (I’m not using recursion, and you usually end up blowing your stack and generating an error, rather than just locking up). I’ve tried updating my graphics device multiple times, updating Unity, etc, but this problem has been ongoing for the last couple months, with no change in behavior.

I’m an experienced Unity developer (shipped a major console title), and never encountered anything like this at work. My home copy languished in 4.x before I upgraded to 5.x, and the problem happened with both versions, so I don’t think this is a new issue. That makes me think it’s something weird with my hardware configuration, so I’m attaching my [87465-dxdiag.txt|87465].

Anybody else run into a similar problem, or have any ideas on what’s going on?

2 months later, and this is still happening. I effectively can’t use Unity.

I have the same “tab out” issue with 5.6.1f1

I’ll tab out and go dink around with something else and if it sets for an hour or so when I come back the editor stops refreshing the display. The last time it happened I used a half workaround of opening task manager to shock it out of deep thought, then going back to Unity and pressing play. when I heard the title music I hit play again (with no visual response from the editor either time) and it stopped the music. I then hit save scenes & save project then exit so I could avoid a catastrophic end task that can damage files.