Xcode 7.2 excessively high CPU usage?

While it's supposed to be idle I'm getting cpu loads of 140% - 190%. The message in Xcode is "indexing | Prebuilding...". How do I turn off this prebuilding feature, assuming that is what is causing the high cpu usage. Needless to say, typing is very choppy beacuse of this. And of course this didn't occur with Xcode 7.1.


Anyone have a solution? I'm running on Yosemite 10.10.5.


Thanks,

Neal

Answered by neal1 in 96048022

The issue with high CPU usage just went away on its own, even with indexing enabled. Perhaps I just needed to be patient until it completed its task.

Same thing here. Xcode has never been so slow. It's ****** up. Can't even work with this ****. Index takes forever.

Agreed. I'm using a Mac Mini (late 2014) with 16GB RAM and an SSD with Yosemite 10.10.5. Never had Xcode 6.x or 7.1.x exhibit such high CPU usage.

Have you considered updating to El Capitan (10.11.12)?

For me it takes a signficantly longer amount of time to build and run. Seems to get stuck 3/4 of the way through and hang for a while. I notice the SourceKitService jumps up to 200% CPU utilisation when this is happening. I cleared the Dervied Data folder and did a clean build folder. Also rebooted machine. It was working fine in XCode 7.1.1. Swift 2 iOS project.

And I'm on El Capitan 10.11.12.

It's all working smoothly now. I had to disable index (large project).

How do you disable indexing? Although I'm not sure this will fix my issue since it exhibits high CPU usage even when the "indexing | prebuilding..." message is not there.

I would consider it, were it not for the fact that svn support is very broken in Xcode 7.x.


I need to use Xcode 6.4 to do my subversion commits and branch merges. (I've already filed bug reports for the source control issues). Unfortunately Xcode 6.4 does not run on El Capitan. Not pleased with the state of Apple's latest Xcode.

Open Terminal


To DISABLE index type:

defaults write com.apple.dt.XCode IDEIndexDisable 1


To ENABLE index type:

defaults write com.apple.dt.XCode IDEIndexDisable 0



While you’re at it, you should delete the key you added as well:

defaults delete com.apple.dt.XCode IDEIndexEnable




** This will clean all your builts and simulators. You can add them again in Devices. I had around 5 gb of simulator trash before this. Hope it helps. I think Xcode should have a boolean checkmark inside Preferences for this action.

I have found that both the OS X 10.11.2 update from OS X 10.11.1 (El Capitan) and the Xcode 7.2 are running "hard". CPU ussage is way up and everything is sluggish. Xcode takes time to come. THe Document update took over 24 hours

Unfortunately that did not address my issue. CPU usage is still between 150% - 200% even after disabling indexing. Looks like I will be filing yet another Xcode bug report.


Thank you for your time .

I'll note that it's a bad idea to disable indexing. You might be able to do that, as you showed, but there's a reason for why that's not exposed in Xcode's UI. Lots of features in Xcode depend on data from the index, and the over all experience of Xcode will be significantly altered.

Well, It's a far better idea than to wait for an update while losing money and potential users. Not to mention the holyday season. (index freezes Xcode).

Hi Joar,

disabling indexing did not alleviate the excessively high CPU usage. Is filing a bug report the only recourse, and if so what should I include in the bug report?


Thank you,


Neal

Accepted Answer

The issue with high CPU usage just went away on its own, even with indexing enabled. Perhaps I just needed to be patient until it completed its task.

That's what I assumed might be the case. When you install a new version of Xcode (and really, this is mostly about the new SDK + compiler) we have to rebuild and reindex everything. This will take a while the first time you open your projects after the upgrade. Once things settle down, I would not expect for Xcode to perform any different from any recent version of Xcode that came before.

Xcode 7.2 excessively high CPU usage?
 
 
Q