Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Unity Editor Progress Bar stalls (request for bug reports)

Discussion in 'Editor & General Support' started by richardkettlewell, Jul 8, 2021.

  1. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    Opening a simple project, default HDRP template.

    Annotation 2021-10-10 155338.png

    Code (JavaScript):
    1. New input system (experimental) initialized
    2. [Project] Loading completed in 629.344 seconds
    3.     Project init time:                 1.547 seconds
    4.         Template init time:         0.000 seconds
    5.         Package Manager init time:         0.000 seconds
    6.         Asset Database init time:         0.000 seconds
    7.         Global illumination init time:     0.000 seconds
    8.         Assemblies load time:             0.000 seconds
    9.         Unity extensions init time:     0.000 seconds
    10.         Asset Database refresh time:     0.000 seconds
    11.     Scene opening time:             352.469 seconds
    12. EditorUpdateCheck: Response {"updateinterval":3600} updateurl =  interval = 3600
    from the log file unity is not clear. it took 352 seconds to open an empty scene with a total of 629 seconds for opening the entire project

    Unity team, can you look if you have forgotten to reset some internal timer inside you editor that is set to 10 minutes instead of 1 minute or less? Really, it may just be some simple value forgotten somewhere that stop the software loop waiting for something and it always does this for 10 minutes.
     
  2. Xirion11

    Xirion11

    Joined:
    Feb 7, 2014
    Posts:
    9
    This issue happened to me on Unity 2020.3.20f1 on a blank project after importing Doozy UI Manager (V4). The editor freezes for 15+ minutes when I open the project or select anything related to Doozy or open its UI Menu. After the freeze is over I can keep working as normal. I do not know what I can provide here to help debug this.
     
    Last edited: Oct 12, 2021
    Wavinator likes this.
  3. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    355
    For information, I have solved my problem.
    For some unknown reason Windows Defender was locking a DLL in the temporary folder of my project, so Unity couldn't rebuild it.
    I don't know why it did that, there was no updates and I changed nothing to my configuration.

    Telling to Windows Defender to ignore my project's directory solved the problem.
     
  4. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    The behavior for me is the same in this exact situation (I have unity 2021.1.24f abd same asste doozy 4) is that unity will reimport/reanalyze all assets files when loading the project. It takes up to 10 minutes to load the project.

    I've then added to the project ProBuilder and uMotion using the package manager/asset store and it took 30 minutes to import them because it reimported or rechecked ALL the assets already present in the project, Doozy and the HDRP example assets (the room with the chair and plants from unity).

    My understanding is that it should had imported the new assets files NOT the existing one.

    I was seeing all the files listed under the loading bar, and the editor just listed them one by one. It also took a long time for each file to go be verified. Files are small, but I can see them sometimes for seconds listed under the loading bar. Not sure if an update delay of the loading bar interface or an indication of something wrong.

    That asset, doozy, have 15k files. I've not even started to add MY game files, textures, objects.

    Maybe unity have this issue when there are many files?

    Also each file/asset in the project have a companion "artifact" file created by unity. Those damn "artifacts" files are all over the disk fragmented in small pieces. Like grain of sands all over the place.

    Currently for a project that have HDRP starting template, Doozy 4, uMotion and ProBuilder I have 52.175 artifacts files for a total of 2.02 GB of disk size.

    Checking the disk fragmentation those files are literally like grain of sands spreaded all over the disk. I guarantee that for small files it takes longer to read you artifact file that opening the original asset file.

    It may make sense to have a small reference file for a huge asset, like a model that is 100Mb or something but why not having some internal database solution that is build to deal with small files

    Did you did any test to see if this "artifact" concept works when you have 50k or 100k files in the project? Maybe if you have a lot of files then you have a problem.

    What are these arifacts files anyway? Do we need them? :D
     
  5. SylafCode

    SylafCode

    Joined:
    Jul 24, 2020
    Posts:
    5
    Hey, so I haven't seen this thread and I created one last week : https://forum.unity.com/threads/uni...-process-that-blocks-editor-loadings.1180099/

    The loadings were saying: "Application.executeMenuItem" (if we save a scene), "ProjectBrowser.OnGUI.ExecuteCommand" (if we duplicate an asset) or "Application.enterPlayMode" (if we enter play mode).

    To unlock the loading, we are to open the Process Manager, find the Unity process, open the subprocesses and kill the one who is responding (not the one who is unresponding).

    When we do that, the popup say "Application.reload" and the loading restarts and work well.

    [...]

    We also have long "Refresh Asset Database" time when we open Unity (up to 10 minutes), and we can't kill any process during that time.​

    Have you had a similar issue?
     
  6. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    Ok, I have new theory which may have some truth.

    Unity will write to the Library folder huge numbers of small size "artifacts" files

    At least one reason of these continuous slow downs may be a combination of a normal HDD having some level of fragmentation which increase the chance of spreading the "artifacts" files all over the disk. And also break those artifacts files in multiple pieces.

    So, when you start adding files to project the number of paired "artifacts" files grow, they may be hundred of thousandth of those files for a normal 3D project. Those files end up like grain of sands all over the disk and they will also will be fragmented.

    You can check this by using a defragmentation software that shows location of the fragmented files on disk in a graphical way. In my case they were all over the disk exactly like sand between other files.

    For example on the project I'm working which have only the HDRP setup and DOOZYUI4 I have around 50k of artifacts files. I still need to add a lot of files and asset to the game so I predict getting to higher number or artifacts soon.

    So 50k divided by an average of 3 pieces, we have 150k of small pieces all over the disk. When unity starts (or for some other reason during editing) it needs to read all or part of those files. On a normal HDD this will take minutes as accessing and reading small files is very slow.

    I've moved the project to a SSD (yeah I know why not thinking before about it) and the loading times and interruptions appear to take less time. Instead of waiting up to 8 minutes to load the project now it takes 1 or 2 minutes which make sense because the SSD is faster in reading small files.

    Now I've got tricked in thinking a normal disk may be fine because is a slow build if you disk is not fragmented and the project starts with a small number of files. But once you start adding stuff and the fragmentation increases, you slowly build up to this issue.

    edit: sorry for posting this two times, I've posted this in another thread, wanted to post it here
     
    richardkettlewell likes this.
  7. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    384
    In my case it doest recover at all even if I wait for an hour... It get's stuck with the "Reload Script Assemblies" dialog forever... Is still the same problem ?

    Currently using 2020.3.20 on MAC bigsur 11.6
     
    KAJed likes this.
  8. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    Couple of days later I think this fragmentation problem may had been the issue. I'm not sure if the editor still writes or reads files without any apparent logic behind the operation. If it does, it is not visible to me at the moment

    Opening the projects works fine and fast. I can even keep 3 editors (of different versions) open with 3 different projects at the same time and switching between them works ok, no blocks or delays. All are on the SSD off course.

    So if anyone have this issue, first check your HDD fragmentation, if you have all those artifacts files all over the place then get an M2 SSD. You don't need an expensive one, one that have 128Gb probably will work fine, I think it depends of how heavy your project is/will be, if you need more storage.
     
  9. SFvdB

    SFvdB

    Joined:
    Mar 10, 2014
    Posts:
    27
  10. SylafCode

    SylafCode

    Joined:
    Jul 24, 2020
    Posts:
    5
    I had no issue on this project in unity 2019.
    I'm on SSD

    But yeah, the Artifacts folder is bigger than the Assets and the .git folders combined x)
     
  11. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    98
    Random thought of the day related to import hangs:

    Every now and again I attach the VS debugger to the Unity process when this happens to figure out what is hung. As is usual: it's hung on mono_os_mutes_lock

    In today's adventure the source is from the collab plugin accessing AppDomain then The Assemblies, and calling https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.reflectiononly?view=net-5.0

    Whatever happens in that function - specifically the getter of the property (I assume looking in another assembly?) causes a lock on the main thread which is never recovered. It appears to be loading the Assembly class specifically causing the lock.

    In 99% of times I've looked in to this it is always the same situation but from a different source.
     
    pistoleta likes this.
  12. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    384
    Are we all using Collab? I am.
     
  13. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,645
    Collab's getting killed off now, so it's time to switch to a proper version control system.

    It wouldn't surprise me if Collab is the culprit of a lot of slowdowns since it was always bad at everything :p
     
  14. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    384
    Collab is not getting killed, is just changing the name for Version Control and some features are being added.
    But yeah I will not argue that is a very good version control system.
     
  15. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    98
    It's not specific to collab, it just happens that collab leads to calling into other, possibly not fully loaded, assemblies. This is why people often point fingers at Odin - lots of assembly reflection stuff happening.

    In most of my projects collab has been removed. It just happens that today's testing was not.
     
  16. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,263
    KAJed likes this.
  17. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    384
    We just moved from collar to Plastic and yeah... it keeps happening :(
     
    KAJed likes this.
  18. zackblack

    zackblack

    Joined:
    May 17, 2015
    Posts:
    65
    Well... I am in here too because of these same problems. My project has become almost unusable/non-responsive on my two work PCs. I think what Unity really needs now is in internal "task manager" window that shows all running Unity processes with status bars. I've used tools like this in the past (mostly in e-mail apps) whenever the network appeared to be stalled. It should probably even be built in to the "Hold on" dialog or something to be able to easily identify if two processes are competing with each other.
     
    Flavelius, OCASM and KAJed like this.
  19. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    880
    Today i got a stall on Quit, this was a new one, the only option was force killing the process.
    upload_2021-12-2_13-38-29.png
     
  20. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    do you have the project on a SSD?

    I'm just curios why I managed to fix this by moving the project from a heavily fragmented normal HDD to an SSD
     
  21. zackblack

    zackblack

    Joined:
    May 17, 2015
    Posts:
    65
    A fragmented file is literally stored on the drive in pieces instead of one contiguous block, requiring the drive head to jump around randomly as it reads the files, which is much slower. A normal HHD is also MUCH slower than any SSD. The "Hold on" box went away because the display threshold is above the time that's needed to read your files.
     
    Last edited: Dec 2, 2021
  22. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    yes, but some people who say they have this issue they said they have SSD. so either they don't actually know if they have SSDs or normal HDD or I'm wrong about my theory that heavy fragmentation together with hundred of thousands of files generated by unity is the fault here
     
  23. zackblack

    zackblack

    Joined:
    May 17, 2015
    Posts:
    65
    Yes, I have this issue and I am using SSDs on both PCs. The dialog box itself isn't a problem - it's if Unity is hung up on some process that's making the Editor unresponsive. So it could either be a slow, fragmented drive, or pretty much a dozen other things that could be wrong with your project. Seeing a simple dialog box is really a broad and vague issue, which is why Unity needs an internal process viewer so we can see what it's actually doing when it's unresponsive.
     
  24. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    880
    I'm also working on SSDs exclusively and i don't think it's related to that as it happens so randomly (and when it happens that it never recovers), it's more likely something locking up internally.
     
  25. itsjustmeagain

    itsjustmeagain

    Joined:
    Dec 1, 2016
    Posts:
    11
    What options do we have to fix Unity? If I remember correctly, this wait-issues started with Unity 2020. Me and my team has experienced this issue for about 2 years now in different projects and different computers.

    It's also really a bad UI design to show popup-modal windows in 2021. It's probably the core-parts of the editor that shows it's age?

    By upgrading my simple test project to 2021.2.5f1 the annoying popup timer window went away in just 4 seconds (empty scene on a 12900k CPU) - It was about 8 seconds with Unity 2021.1.11f1
     
    Last edited: Dec 9, 2021
    Vagabond_ likes this.
  26. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,263
    Read the OP, check what's happening, identify the problem, if it's something in your code, fix it, if it's something in third-party editor script either fix it or ask its developer to fix it, if it's something Unity is doing, submit a bug report...
    You can also set the latency how much time should pass before the dialog shows up.
    And obviously have all the project files on SSD.

    Also: make any Unity or project folders an exemption from any application which observe or can block files like anti-virus software, defenders, etc. Nothing should observe these files except Unity.
     
    LeonhardP and richardkettlewell like this.
  27. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    While I can understand the logic behind this argument, is not good practice, because malware may infect files in those folders. Unity as a software needs to work with antiviruses or defenders or the rest. Which they probably do, to be fair.

    These hold on message errors may be something that is so hard implemented inside the software that by this point unity chose to ignore the issue, move on to newer versions and hope people will slowly fade away from using the 2020.
     
    LancelotC01 and KAJed like this.
  28. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,263
    - project files are low-risk files, vast majority are text or image
    - there is nothing in there what at at least one point wasn't somewhere else scanned by said software
    - obviously if your computer infected, you will scan and repair your entire computer, but then slow progress bar is your least problem
    - it is virtually impossible statistically that your computer is infected, but only your Unity files get infected, nothing else, what could alert you to the problem (BTW, stop clicking on shady things on the internet and opening files from unknown sources and you basically cut your risk to hundredth of the original)

    Aham... it doesn't look like they are ignoring the issue. At least to me. Maybe our definition of "ignore smthg" is different though. Asking for reports about the problem is the opposite of ignoring, in my book.
     
  29. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    They have asked for reports 6 months ago. :D

    No answer till then. I will go with my "ignore and let it pass" theory for now. If they could had fixed this easily they would had already did it.
     
    LancelotC01 and KAJed like this.
  30. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    I want to add that I didn't experience this problem anymore from the moment I've moved all projects from that heavily fragmented normal hard disk to and SSD.

    I've looked at the files from the unity projects in a defragmentation software that show the location on disk and there where probably 300k+ fragments all over the disk like sand. This made sense to me as accessing all those files if unity wanted to access them all or at least a significant part could take minutes.

    It also made sense because moving the entire project folder to an SSD (so a "read operation" on the normal HD) took around 6 to 8 minutes.

    After I've successfully moved the folder I've deleted the files which took windows another 7 minutes (so a "delete operation")

    If unity decided, for some reason to update those small files (so a read, delete, write operation) the editor would be blocked for around 10 minutes+ which makes sense.

    The files I'm talking about are those located in

    "YOUR PROJECT FOLDER NAME\Library\Artifacts


    So I don't have the issue anymore (after probably 8 months of struggling and even abandoning unity for months because of this.

    Before I did this I was not able to work on the editor because it remained blocked at random for 10-15 minutes at the time maybe two-three times an hour.

    After I've moved the project, I can keep 3 (three) unity editor open each with three projects open and all work fine. The same projects that had issues on the normal HDD.


    I have 3 editor/project opened because when dealing with this issue I wanted to rebuild the project that had the issues so some stuff I need is in one project, something else in another, so I want to consolidate them in one project. Except I was remembering where everything was or how was set up so I kept multiple projects open to verify.

    I'm saying that unity could chose to ignore this issue (IF is a fragmentation issue/coupled with unity writing massive amount of data) because there is nothing they can do to prevent the files getting fragmented. And most of high end users that pay for the PRO version would have fast SSD installed. So what they could do? How to you fix a fragmentation issue?
     
    stuksgens likes this.
  31. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,031
    What editor version you are using ?
    For how long you have the projects running now on the SSD ?

    If not yet, try working for a few of days and see if it will brake again !

    I am using a pretty decent machine with 16 cores CPU, 16 gigs of ram and a M.2 1000GB SSD and i have this issue even on brand new projects. All appears after i add some tools like spline editors, environment tools etc...

    Also, for me it is not always related to I/O operations but to CPU time, like CPU is executing some editor Code !

    Unity 2021.2.x doesn't fix it for me nor the latest 2022 beta !
     
    Last edited: Dec 15, 2021
    KAJed likes this.
  32. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    532
    At the moment the editor is 2020.3.22f1.

    I've worked on and off for around a month. October till November. works fine for now.

    I actually discovered this issue because I've created an empty project, imported an asset named "DoozyUi 4", and this asset installed 15.000 files, and this got the editor to experience the issue immediately.

    While normally it was a slow build because you don't add so many files immediately in a project.

    I've said first, what the actual f.. the author did here with all the files. Then I've noticed that unity create a companion identification file for each of those 15K file (the one from artifacts folder) Then those 15K artifacts companion files become 75k+ fragments. For some reason unity decided randomly to read all or maybe part of those files, got the holdon loading bar for minutes.

    I've put an SSD in the computer, moved the empty project with that Doozy asset on that drive, no more issues.

    Ok please verify something first.

    How many files do you have in the artifacts folder on the project that has issues?
     
  33. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    36
    Annoyed that I just found this thread just now.
    But I've been having this issue in unity for MAAANY months now.
    I have been updating unity all the way from probably 2021.1.15f1 all the way to 2021.1.27f1 hoping that this issue was going to be fixed in one of those versions. Absolutely nothing.

    But it seems like this thread existed for a large chunk of me having this issue. So I'm glad to know that the Unity devs are aware of this issue.

    I made an initial post about this in september of 2021
    https://forum.unity.com/threads/lau...mporting-busy-for-xx-xx.1166429/#post-7501084
    but had this issue for a few months prior.

    When I launch unity for the first time (on a particular day, booting up my pc) the loading bar will freeze on "Importing..." and never go anywhere.

    The key identifier of the issue is that if you wait about a minute, force quit the program. And relaunch, it opens fine.

    Theres nothing in the log file that necesarily indicates where it's getting stuck.

    The last lines in the log file are

    ExitCode: 0 Duration: 0s649ms
    *** Tundra build success (0.56 seconds), 0 items updated, 770 evaluated
    AssetDatabase: script compilation time: 1.401324s
    Begin MonoManager ReloadAssembly
    Symbol file LoadedFromMemory is not a mono symbol file
    Symbol file LoadedFromMemory is not a mono symbol file
    Symbol file LoadedFromMemory is not a mono symbol file
    Native extension for WindowsStandalone target not found
    Refreshing native plugins compatible for Editor in 181.39 ms, found 6 plugins.
    Preloading 0 native plugins for Editor in 0.00 ms.

    If I force quit and relaunch, the lines that would follow this are for logs for custom scripts that run when unity is initializing
    with the [InitializeOnLoadMethod] attribute (or whatever its called)

    But It's clear that this issue is due to something involved with asset importing.
    And other people saying that it's related to trying to import an asset that is "out of date"

    EDIT: I have also made a bug report just now
    Here is the ticket id
    1389903
     
    Last edited: Dec 21, 2021
  34. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    98
    Fragmentation and a fast SSD are not the only things at hand. This I can assure you.
     
    Andrew900460 likes this.
  35. SylafCode

    SylafCode

    Joined:
    Jul 24, 2020
    Posts:
    5
    When I have the issue, I go to the Process Manager (windows) and often have two Unity processes: one that doesn't respond and another one running. I kill the one running and it unblocks progress bar.

    It doesn't work on the progress bar related to Unity starting up but does work for OnGUI processes, StartPlayMode, starting a build, etc.

    Still. It makes us lose a lot of time (when we don't see it), do Unity have any idea how to fix that?
    I don't have the issue in the previous Unity version.
     
    Andrew900460 likes this.
  36. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    36
    When you say you force quit the Unity process that is running, is that one of the "child processes".
    So for me I have:

    Unity Editor (4)
    Console Window Host
    Node.js: Server-side JavaScript
    UnityCrashHandler64
    Unity Editor [not responding]

    You close one of those child processes?? Is what you're saying?
    If so, which one exactly?


    Also what version of unity are you using?
     
  37. Jordi_Unitys

    Jordi_Unitys

    Joined:
    Dec 15, 2016
    Posts:
    14

    The problem still persists on 2020.3.22f1.
     
  38. LancelotC01

    LancelotC01

    Joined:
    Dec 17, 2019
    Posts:
    1
    Unity compressing the script file?? why??

    Unity 2020.3.25f1
     

    Attached Files:

unityunity