Search Issue Tracker
Fixed in 2021.1.X
Votes
0
Found in
2019.1.0a10
2019.4
2020.1
2020.1.2f1
2020.2
Issue ID
1270762
Regression
Yes
CPU usage raises to ~70% when the Editor is in Play Mode and not in focus
How to reproduce:
1. Open the attached project "1270762.zip"
2. Open the "Test" Scene
3. Enter the Play Mode
4. Check CPU usage using the Task Manager (or any other performance monitoring tool)
4. Focus on some other app by clicking on it
5. Check CPU usage again
Expected result: the CPU usage stays the same (or decreases) after focusing on another app
Actual result: the CPU usage raises to ~70% when Editor is not in focus
Reproducible with: 2019.1.0a10, 2019.4.11f1, 2020.1.7f1, 2020.2.0b6
Not reproducible with: 2018.4.28f1, 2019.1.0a9
Notes:
- Reproduces even when the Application.targerFramerate is set to 60
- CPU usage raise is less noticeable in 2019.1.0a10 (raises from ~5% to ~15%)
- Only reproduces using a Windows operating system
- Steps to reproduce on a new project:
- - Create a new folder
- - Inside it, create another empty folder and name it 'Assets'
- - Add the folder as a project in Hub and open it
- - Enter the Play Mode
- - Check CPU usage
Comments (1)
-
pastaluego
Oct 07, 2020 19:23
I just want to clarify a bit more about this issue.
I'm almost positive that the increase in CPU usage is a result of EditorLoop framerate not being throttled when the editor is in play mode and out of focus.
I personally was not able to reproduce it on any version other than 2020.1 and 2020.2, but I didn't test THAT many versions and subversions of 2018.x and 2019.x.
The only thing I noticed was that in the context described (in play mode & editor out of focus), EditorLoop>Application.Idle wasn't being called in the profiler of 2020.1 and 2020.2, but it was in 2019.4 and below.
Another way to see if this issue is affecting you:
1. Turn on Editor Profiling in editor.
2. Enter Play Mode
3. Change window focus away from Unity Editor
4. Wait 2-3 seconds and click back into Unity
5. See that the profiler in those 2-3 seconds recorded 10-30k frames while the editor was out of focus.In 2019.4 and below during that scenario, the profiler just records a few frames because the framerate gets throttled when the editor is out of focus while in play mode. But in 2020.1+ it records tens of thousands of frames because of my assumption that the EditorLoop framerate isn't being throttled. That might not be the exact problem, but I do know the EditorLoop framerate during the described scenario is the core of the issue.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- ACES Tonemapping causes banding artifacts and negative values in ColorGradingLUT when HDR is enabled and "High Dynamic Range" Grading mode is selected while Android Platform is used
- Android Player freezes when an Audio Source is playing and an incoming call is picked up and then hung up and the Audio Source is started again
- Green success icon is poorly visible in the light Unity theme
- Incorrect input into the Input Field when using Microsoft IME Japanese
- Multiplayer role "ClientAndServer" is displayed without the spaces in the "Play Mode Scenarios" window
Resolution Note (fix version 2021.1):
Fixed Unity Editor not throttling CPU usage correctly when play mode is on and Unity Editor is out of focus.