What is SourceKitService, and why is it using so much CPU?
Last reviewed: 19 November 2026. Path and parent process checked with Xcode 26.6 on macOS 26.3.1.
SourceKitService is the Swift language service that Xcode and other editors use for code completion, syntax coloring, live errors and indexing. It does a light form of compiling every time you type or open a file, so large Swift files, complex type inference and big projects can keep it at high CPU and memory. Simplifying slow expressions, closing unused projects and letting indexing finish are the main fixes.
SourceKitService at a glance
| SourceKitService | |
|---|---|
| Made by | Apple (part of Xcode and the Swift toolchain) |
| Type | XPC service (Swift language service) |
| Location | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents/MacOS/SourceKitService |
| Runs as | your user |
| Can you quit it? | Yes. Xcode starts it again; code completion and highlighting pause briefly and may show a notice that SourceKit restarted. |
What is SourceKitService?
The Swift project describes SourceKit as a framework for IDE features such as indexing, syntax coloring and code completion, and says its C API in sourcekitd.framework uses an XPC service for process isolation. SourceKitService is that XPC service: when the Swift parser or type checker hangs or crashes, only this process is affected, not the editor.
It ships inside the toolchain in Xcode, so its version follows Xcode. Other tools reach it too: sourcekit-lsp, the language server used by editors other than Xcode, is built on sourcekitd.
Is SourceKitService safe?
Yes. It is part of Xcode, signed by Apple, and runs as your user. It only reads the source files of the projects you open.
Why does SourceKitService use so much CPU and memory?
- Type-checking while you type. Each edit makes SourceKit parse and type-check the file for errors and completion. Long expressions that mix literals, operators and closures can take the type checker a long time.
- Opening or switching to a large project. Opening a workspace makes it process many files and modules, which shows as sustained CPU until the editor has caught up.
- Large files and many open editors. It keeps syntax trees and type information for open files in memory, so very large source files and many open tabs raise its footprint.
- Code completion in big modules. Completion has to consider every visible declaration, including imported frameworks, so it costs more in projects with many dependencies.
How much CPU is normal for SourceKitService?
While you type in a Swift file, short bursts of CPU are normal. With the editor idle it should drop to near 0% within a few seconds.
Its memory varies with project size; a large app can keep it well above a few hundred megabytes.
How do you stop SourceKitService from using so much CPU?
- Find slow expressions. In the target's Build Settings, add
-Xfrontend -warn-long-expression-type-checking=200to Other Swift Flags. The compiler then warns about expressions that take longer than 200 ms to type-check, which are the usual cause of a busy SourceKitService. - Add explicit types. Give long literal arrays, dictionaries and chained closures an explicit type, and split long expressions into smaller ones. This reduces the type checker's work in the editor and in builds.
- Close projects you are not using. Each open workspace adds files for SourceKit to track. Close extra Xcode windows and editors pointed at other Swift projects.
- Quit it if it is stuck. Quit SourceKitService in Activity Monitor. Xcode starts a fresh one when you next type, which clears a hung request.
When should you worry about SourceKitService?
If it stays at 100% CPU with the editor idle for many minutes, or crashes repeatedly, one file is usually the cause. Close files one at a time to find it, then simplify its slowest expression.
A process with this name outside an Xcode or Swift toolchain folder is not Apple's.
How do you check SourceKitService in Activity Monitor and Terminal?
Open Activity Monitor (Applications > Utilities), and type SourceKitService in the search field. The CPU tab shows its % CPU. The Memory tab shows its Memory. Double-click the row for its parent process, memory details and open files.
In Terminal, the first command lists every SourceKitService process with its PID, user, CPU and memory (RSS is resident memory in kilobytes).
ps -axo pid,user,%cpu,%mem,rss,command | grep -F 'SourceKitService' | grep -v grep
How can Thrum help with SourceKitService?
Thrum keeps a live CPU graph in the menu bar. One click shows the eight processes using the most CPU, so you can see when SourceKitService is among them and how much it takes. An optional alert tells you when a process stays above a CPU level you choose (50 to 200% of one core) for 1 to 10 minutes. Click SourceKitService in the list for its PID, threads and memory, and Quit or Force Quit it after a confirmation.
Thrum is $4.99 once with a 14-day free trial and no account. It requires macOS 26 Tahoe on Apple silicon or Intel.
Questions about SourceKitService
What does SourceKit service terminated mean in Xcode?
SourceKitService crashed or was quit, and Xcode started a new one. Editor features return after a moment; frequent crashes point to a file or construct that SourceKit cannot handle in that Xcode version.
Is SourceKitService the same as the compiler?
It uses the same Swift front end to parse and type-check, but it serves the editor. Builds run separate swift-frontend processes.