Unity Editor keeps freezing randomly. How to find out why?

I am creating a physics heavy 2d game with the latest version of Unity. Lately the editor has stared to freeze on play mode almost every time. The whole program just freezes after 1-5 minutes of play mode and I have to kill Unity from Task Manager.

First I made sure there are no infinite loops nor functions calling itself. Then I tried to pinpoint the problem by disabling some scripts and objects. I also tried to put Debug.Log(“location in code”); -lines in my scripts to find out in the console where exactly does the crash happen. But I haven’t been able to find anything useful, the editor freezes always outside of any function from any script. Is there any tool or magic trick that could give me any additional information about the crash?

thanks arpian for your reply… i fixed it already…

wonderful genius from unity team helped me. there was some problem with using direct x 11

so force unity to use directx9…
here is the fix…

on windows 7 64 bit
just open unity from command prompt using following command

C:\Program Files\Unity\Editor\Unity.exe -force-d3d9

everything is fine…

unity people are great

hey the freeze problem is happening to me in windows 10, 64 bit, what i have to say in command prompt? pls i really want to back to use unity normally.

Hey there @Mateus0105 and everybody. just go and open a folder and then click the path bar and then type
C:\Program Files\Unity\Editor\Unity.exe -force-d3d9 (like @3dunityfan said for the cmd) and then it will open unity with dx9 but you will have to do it everytime you wanna open it. and you should could tell if its dx9 or 11 by looking at the top of the tap where unity is open
Well have a nice day
and make some good games or whatever your now doing

This no longer works in unity 2017f3, how to keep it from freezing now?

hi same thing here . im in 2017.2 if i switch the window back and forth or press a different button it takes like 5 minutes to work . really slow now how to fix?

java string interview questions

I tried -force-d3d9 but it ain’t working?