5.5 frequently freezes when compiling

Do anyone else experience a freeze in the unity editor when it compiles code?

It happens occasionaly, I don’t know how to create a bug report related to this.

I had no problems with previous versions.

Freezes yes, but not really related to compiling code I believe. In my case, the editor freezes when I open certain applications, such as Notepad++.

See https://forum.unity3d.com/threads/5-5-0f3-frequent-editor-freezes.444160/ for my findings.

I use visual studio 2015 and I worked on 3 seperate projects, they all freezed frequently. It’s always when I write or change some code and save it, then focus back on the unity editor, it freezes.

I will keep the conversation on your thread, hope we will get a solution.

I’ve had this going on with all versions of Unity 5.x, I thought this was normal. Is it?

I never had this before 5.5 release

I have this same exact issue: after changing code in Visual Studio 2015 and switching to Unity sometimes it freezes on compiling. The project is quite big, so it takes about 10 seconds to compile, and there are a 3-4 seconds when the compile icon in the lower right corner isn’t even spinning - this is the part when it sometimes freezes.

Checking in the Task Manager in the Details tab (I’m using Windows 10), right-clicking on Unity.exe and selecting “Analyze Wait Chain” I can see that one of the Unity’s threads is waiting on another thread.

Is this what is happening in your case as well?

Edit: I use Unity 5.4.3, 64-bit version

Yes it is the same behaviour. But I only experienced it with 5.5. Latest 5.5 patches solved this for me.

So I dug a little bit deeper into this, and what seems to happen is that it is hanging on Mono.dll, the “virtual machine” that plays the game in the Editor. In the Editor.log that the last thing before hanging is “Begin MonoManager ReloadAssembly”, and the thread that Unity is waiting on is “Mono.dll!unity_mono_method_is_generic+0x5408”. If I kill this thread in ProcessExplorer, then Unity either crashes or comes alive again, but upon play it gives a lot of errors (obviously, because the code was not compiled or wasn’t loaded into the “virtual machine”.
However, I still don’t know why reloading the assembly fails.

So I’ve also researched Unity answers and forums, and these are the reasons given:

(as the esteemed reader might guess, I’m also using this thread to document my findings).