This is NOT a Beta issue. I am on Xcode 6.0.1, production release. The issue I am having is that when I try to do a Build or Run the code I am working on, Xcode becomes unresponsive for large periods of time and the SourceKitService consumes upwards of 400% of the CPU (according to Activity Monitor). This issue is new as of the last few days, although, oddly, I had been on Xcode 6.0 since it was officially released on Sept 17. I upgraded to 6.0.1 hoping it would contain a fix for this issue.
Any idea as to what the problem could be?
I was facing the same problem after migrating the project to swift 3, find out solution it was taking time because of dictionaries and array created without data type.
This behavior appeared in my project when I accidentally declared a class that inherited from itself. Xcode 8.2.1, using Swift 3.
I spend 4 hours to figure out problems in a long compilation of my project. The first try takes 42 min to compile.
I clear all cache from
/Users/myname/Library/Developer/Xcode/DerivedData/ModuleCache/
as was suggested by @LNI, after restartSourceKitService
and apply few changes for code:1) To
From
2) To
From
3)
To
From
As result compile time - 3 min, not so fast but better for 42 min.
As result, before
SourceKitService
- take ~5,2Gb of memory and after ~0.37GbI also had this issue, in my case I was declaring a big array like this:
I solved the problem by adding the items 1 per line instead of all at the same time:
this fixed the problem.
I'm having a similar issue with Xcode 8.2.1 - with a section of 1,000+ lines of code commented-out via /* */. Commenting-out the section caused the issue, and removing the commented-out code fixed it.
I resolved another issue that was causing SourceKitService use up to 13GB of memory...
I had String(format line with lots of arguments:
when replaced with this it worked fine (no memory build up and normal CPU consumption)