Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity 2019.3.1f1 uses 100% CPU on 1 core when paused/background in empty project

Discussion in 'Editor & General Support' started by Arkade, Feb 19, 2020.

  1. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    651
    Is it just me that gets 1 core at 100% CPU when paused in a brand new Unity project with Unity 2019.3.1f1 (and .0 before it IIRC)? (I'm using 'legacy' 3D -- non-SRP profile in case that makes a difference).

    I'm sure earlier 2019 builds and definitely 2018 would use ~0% CPU usage where pausing the game and/or switching windows with "don't run in background" set.

    I've attached a screenshot showing (my CPU has 8 cores). It's easy to notice on my laptop where I can hear the fans whiring indicating something is amiss. Obviously it's gobbling up my laptop's battery and quietly killing the planet by spewing out extra CO2 for all the desktops!

    I initially assumed it was caused by some of my Editor scripting but after investigating for a bit, I couldn't figure it out since nothing seemed to show up in the Profiler. Of course then I tried a vanilla project!

    I've logged a bug but not had any response after 3-ish working days so thought I'd ping here in case I was doing something ultra-dumb (it's happened before :rolleyes:)

    Cheers for the help!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,824
    Maybe it is the rendering of the scene view window?
     
  3. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    651
    Reasonable hypothesis with 2 caveats:

    1. It wasn't the case in earlier versions.
    2. It's not the case now. I tried closing all 'internal' windows until I had only the Game view and same behaviour. Tried openning a Console and closing Game. Same. Oddly the Editor used *less* CPU while I was fiddling with the windows. Not sure what that means.

    Can I infer from your question (without any intended scorn ;-) ) that either you don't see this behaviour yourself or you haven't checked / couldn't check (lack of Process Monitor / Windows / whatever)? I'm only asking since it's odd if it's just me, no? :)

    Cheers
     
  4. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
    Where is it?

    I have a similar problem with 2019.3 on Linux Mint, but it's a lot more obvious when I load the Monodevelop (or VS Code for that matter) solution alongside Unity. Then my fans roar and my computer overheats, up to 87 C... The phenomenon is less obvious in play mode.

    Edit: in fact Unity uses up to 100% of the CPU sometimes, even when it's not in play mode and the solution is not loaded...
     
    Last edited: Feb 20, 2020
  5. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,760
    I saw massive CPU spikes in 2019.2 onwards - related to Unity incorrectly spamming some of the Inspector window update loops (I have no idea why - I have a few reproduction cases which 99% of the time trigger it, but can't see the common thread. One of the easiest is certain Shaders if you select them in Project window, their inspectors go nuts).

    But if you're not seein this in 2019.2, then it's presumably something different :).
     
  6. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    651
    Whoops, I've attached the missing screenshot -- sorry. Good thing I kept it on the bug report :)

    Just had a response from Unity who've successfully reproduced it and logged in public bug-tracker as:
    https://issuetracker.unity3d.com/product/unity/issues/guid/1219619

    @APSchmidt interesting point about Linux. I produced on Windows and the Unity person said it doesn't produce on MacOS. I'd assume Linux would be more MacOS-like but it might be good to post your observations as a comment on the bug in case it helps? (p.s. good for you -- I love Linux and wish I could work in it myself. Also "87C" -- overclocker? :cool:)

    @a436t4ataf yeah you're right -- Inspector windows do seem to cause a lot of CPU load in some circumstances. I care about that too but you're also right that it's a different issue. At least there we can quiesce the CPU by unselecting things or closing Inspector windows. Have you logged what you have (if reproducible)? While UT doesn't jump on every bug logged, I personally still feel it's worthwhile reporting with the hope that visibility and weight of users' concern can raise the priority of things.
     

    Attached Files:

  7. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,760
    Re: inspector bug - if/when I can narrow it down, yes. Until then, I already have some bugs that are much narrower, and yet UT support are struggling to reproduce when I'm able to reproduce them 100% of the time, so that's where I'm focussing my attention!
     
  8. snlehton

    snlehton

    Joined:
    Jun 11, 2010
    Posts:
    99
    Voted on the issue. Happens also on my machine. All cores are pinned at 100%.
    WPA shows multiple threads doing some DirectX 10 work:

    upload_2020-3-13_10-54-46.png

    How bad is it? Well... for an empty scene, really bad :)

    upload_2020-3-13_10-55-29.png
     
  9. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
    It seems that the problem has been fixed in 2019.3.5f1. The task manager shows a very low CPU usage with Unity paused and Firefox, Thunderbird running.

    Screenshot_2020-03-13_10-18-50.jpg
     
    a436t4ataf likes this.
  10. snlehton

    snlehton

    Joined:
    Jun 11, 2010
    Posts:
    99
    No it's not, at least for me.

    EDIT: Wait I just realized you had paused Unity. For me the issue only manifests when running an empty scene. No empty scene should consume 100% of all cores of your CPU :) Maybe this is then something else.

    upload_2020-3-13_20-21-14.png
     
  11. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,322
    Yep, that's what the op said in his first post and in the title. :)

    In play mode, in a small project, Unity 2019.3.5f1 uses 13 % of the CPU; it seems that the problem is limited to Windows, at least until a Mac user comes here posting otherwise.

    Screenshot_2020-03-13_19-36-44.jpg
     
  12. yusuf_isik

    yusuf_isik

    Joined:
    Feb 14, 2014
    Posts:
    11
    I opened a new clean project. And I had still same issue in 2019.3.11f1. My Unity was using %12 of my CPU on Editor Mode. Play mode was worse than this. I fixed it by clicking to this button:
    cleanCache.png

    My cache size was 19gb. I clicked clean cache and it fixed my over cpu usage problem. I don't know what it is meaningfull connection with it, but it fixed my over cpu usage problem. I was have %12 cpu usage by unity. Now it is %0. Yes %0.
     
  13. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    108
    I can confirm this, for me it was using 10% CPU and after cleaning the GI cache (0.4GB) it uses 0.1% (I have a 6700K)
    The problem is if unity is in the background it should not even render anything, so it is a bigger problem and should probably be reported as a bug
     
  14. RODOO

    RODOO

    Joined:
    Oct 17, 2019
    Posts:
    1
    please i have the same problem
    help me
    e