Unity keeps freezing every other second for a brief period of time

Hey!

So as titled, my Unity Editor keeps freezing for a brief moment every other second. This is constant and nothing I do changes it. It isn’t just the game window, it is the whole program, all the menus, screens, buttons etc. I have no prior experience with Unity so I have no idea where to look for a fix. Been at fixing this since sunday now.

List of things I’ve already tried to fix the issue:

  • Install to another HDD
  • Update graphics drivers, clean install
  • Force DX9, OpenGL on startup
  • Start program with admin priviledges
  • Install various older versions of Unity

Nothing helps and my Google-Fu has stopped yielding any relevant information. What could possibly fix this?

Post computer specs.

Ah yes, sorry forgot about it.

OS: Windows 7 64-bit
GPU: NVIDIA GeForce GTX 760
CPU AMD FX-6350
8GB RAM

Everything seems in order, I ran Unity on worse.

Assuming your GPU driver is up to date, it may be hard drive activity. I would take a look at you hard drive mode. Try jumping into BIOS and switching between IDE and AHCI. And you’ll probably have to fiddle with regedit, since this is Win7. Switch from IDE to AHCI after installing Windows 7 or Windows 8

Consider that I may be completely off the mark.

Apparently it’s not possible for me to change from IDE to AHCI, at least without doing some weird trickery since I can’t access the BIOS options for that. After that I took a look at the resource manager’s CPU manager and found something very interesting. When Unity is running it COMPLETELY ducks the CPU in 1-3 second intervals when idle. When moving around in the scene it gets even faster.

Here’s a screenshot of it: https://puu.sh/B2ede/7f906667e1.png

HDD activity and RAM work as usual though.

Possible solution: I had this same problem - on playing the scene in the editor, it would run for around 7 seconds, then freeze/lock for about 5 seconds, then repeat this cycle. The culprit for me was Sophos antivirus software. If disabled, Unity ran normally without freezing. I was so relieved to have found the problem I haven’t investigated why this is happening, but my best guess is the record files (simple text files) I’m writing to are being scanned as they update and this is holding things up.

1 Like

I am having the exact same problem as you described. I took a video recording of me walking through the default hdrp scene.

It’s cyclical, every second or so the computer just hangs for a fraction of a second. Notice how even when I’m not running the Unity scene, my cursor turns into the windows spinning blue circle cyclically, just like how the game hangs. What’s the problem?

I’ve tried everything I can think of including disabling antivirus/firewall software, changing the external script editor, etc… And I know it’s not my specs, I have an Intel i7-11700K with 16GB of RAM and a 3070.

Update
I made another video cataloguing the output of Unity Profiler and my task manager.

FIXED IT
The problem was coming from the plugin Github for Unity. I deleted the folder Assets/Plugins/Github and the problems disappeared