I am currently baffled at an issue causing my Unity Editor to freeze without warning, normally when I try to run a scene.
The last two lines in my log file (no errors are logged) are :
Then it just freezes without ever unfreezing (had it run in the background for >1hr once).
About my setup:
Windows 10 - 64bit
Processor : i7
Ram: 32Gb
Graphic card: Nvidia geforce GTX970
Unity: 5.6.1p
I think that it freezes more often when I have chrome running.
Other than that I am not sure how to proceed troubleshooting the problem. Any advice or ideas welcome!
Thanks!
I’m having the same issue with 5.6.1p3. I can’t figure out what’s causing this issue. I can’t close Unity as well and need to end task it. It’s really intermittent but still happens consistently especially when I hit play and run the game a bit and then try to close Unity. This will often times make Unity unresponsive.
About my setup:
Windows 10 - 64bit
Processor : i5 2500K
Ram: 8Gb
Graphic card: Nvidia geforce GTX980
GFX Driver: 382.53
Unity: 5.6.1p3
I’ve tried to update everything - Unity, assets, GFX drivers. Not sure what else to do. Thanks.
I’ve come across this issue a few times. I’m not sure if it’ll help your situation or not but, keep an eye on the unity.exe memory usage. If I’m coding and testing repeatedly, it usually doesn’t have an issue, but when the code doesn’t exit cleanly (i.e. I’m debugging 3AM code) I’ve actually ran into issues with the memory filling up and Unity freezing.
5.6.2 and the same problem - Unity freeze without any errors and CPU and RAM spike. Sometimes I am able to close the Editor with Ctrl + P, but if too much memory consumed, I need to kill the process to prevent it from blocking my computer up.
It happens when I move mouse cursor in the game window.
Yea I’m still dealing with this issue with 5.6.1p4. I checked my ram and Unity is using 400MB or so and I still have a few GB remaining free. It’s really weird.
Usually after I restart Unity, I can hit play once and then after stopping play it’ll sometimes stop responding after a few minutes. More often than not it will stop responding for sure if I try to hit play again for the 2nd time. I need to then “end task” Unity and restart the program.
CPU is stuck at 0% when Unity stops responding.
This is really slowing down my development since pretty much every change I need to restart Unity and open my project again.
Hopefully some one else has some more insight on what’s going wrong?
Mine too with 5.6.1p1 and also 5.6.2p1.
I’ve experienced that if unity freezes, all static members become null with no reason.
So I attached a code somewhere.
And this gets called when app gets freezed.
It also happens on android also, except that appDomain doesn’t gets unloaded, just freezes.
So in UnityEditor, the internal error happens, and UnityEditor in order to restart assembly, it unloads current assembly, and load a new ones.
Actually, my problem was related with AssetBundle.
I made a new project and made a sample which causes the freeze problem.
I’ve reported to Unity QA but they could not reproduce the problem. https://fogbugz.unity3d.com/default.asp?926516_6uerj5vpbu592740
Same problem on 5.6.2f1. From what I can see it has something to do with pressing play too soon after switching to unity from visual studio when it recompiles the code. Also happens if I stop the game and press play too fast.
I had the same issue for the longest time 5.6.1/5.6.2. Very frustrating but eventually worked out the issue to some incompatibility with older add-ons. If you get the same result then maybe you have a similar problem.
When Unity freezes with spinning processing icon (bottom right), go to Task Manager Processes and kill the mono.exe (sometimes there are more than 1).
Unity should now come back and complain about fixing the compile errors.
I made a copy of the project and worked on it to determine the issue. I looked up every downloaded asset add-on and checked the last time it was updated from oldest to newest. Starting from oldest, I deleted that entire add-on folder, commented out any compile errors and pressed play. If same freeze keeps happening, move to next add-on. I was lucky to find it on the second add-on “Easy Sound Manager” released 22 Sep 2016, Unity 5.4.1. Deleted it from my main project and have not seen the issue again. Good Luck
Same happens to me on 2017.1.1p1. Didn’t had a chance to go through all add-ons yet, but I’m not sure if this started to happen after we moved to 2017.1.1p1 or once we imported Facebook SDK… (anyone else using this combination here?)
Also happening to me.
Freezes maybe 20% of the time I hit play, must kill the process.
There is no “spinning processing icon” in the bottom right when it happens to me. CPU is sometimes 0, sometimes 10-15%.
Also, it seems that sometimes if I wait long enough, like 3-5 minutes or so while it is frozen, it will then suddenly proceed to start like nothing was wrong.
This is happening to me now. I have no add-ons. I have Unity 2017.2.0f3
I added some code to listen for UDP packets asynchronously. I can see this hanging or crashing the playback but it shouldn’t freeze Unity itself. I have to use the task manager to kill Unity and restart it completely. I’d be happy to submit a code example if that would help.
I am still receiving this hang on 2017.1.b2. It appears to be totally random - 30% of the time or so. I have socket code, but I can reproduce this on scenes in which no networking is runnig,
Log shows nothing of interest. I do not have any deprecated third party assets. I have had the hang happen on first play of the game after a restart, which suggests it is not un-cleaned up resources from a prior play. Waiting for script loads does not help (but avoids a similar hang in which script reloading occurs during transition into play, which may be related). Reloading scripts does not seem to help.
This is really disruptive to my work,. how do we even file bugs for this?
So I have a solution for my particular issue. Might work for other people
In my setup, I have two scenes that start at play (“Global” and “Game”), one of which is composed of singletons some of which gets marked DontDestroyOnLoad on Awake() in their scripts. The other scene is my level, which takes awhile to initialize due to the size.
I noticed that Unity does not handle mutli-level loading in standalone builds, so I had previously made a third level which merely loads the Global and Game levels and then destroys itself. This works great for Standalone builds and I moved on.
Turns out, using this trick makes the freezing/hangs disappear. As long as the initial levels loaded is only this minimal scene with one script that loads the other two scenes, it never hangs.