Xcode hangs every few seconds?

I have a problem here. Xcode seems to hang and do the rainbow ball and say “not responding” in the force quit box. It does it every few seconds and I can’t figure out why… google just shows a bunch of other people with the same problem, not so much a solution beyond clean out all your Xcode files and start over.

I would suggest that you reboot your Mac when Xcode gets like that. Perhaps you may be running out of available memory due the number of Apps you have running concurrently.

How much memory do you have in your Mac? 8GB or 16GB?

1.4 ghz, 8 gig

I tried some cache cleaning app, cleaned the build and it seems better for now.

the weird thing is I had shut down the Mac for the night it had just booted up. something about the CoreML Courses it did NOT like.

I do have the same problem. It really prevents me from working. I have a 1,6 GHz 8 GB Mac.
I tried all the recommendations. I installed the new Xcode (12.4) version that was published yesterday. I rebooted my Mac. Even when I’m running only Xcode (and off course the Finder) I see the nice rainbow ball quite often. It disappears after 10 seconds or after one minute or

Anny other suggestion?? Some people recommend to have a look at the activity monitor. But this does not say me much