Blog

Xcode

Xcode macOS SwiftUI High Memory Usage

I have been experiencing what I believe is an Xcode v13.1 bug. When creating an app using SwiftUI for macOS, when I copy/paste logic from another file sometimes the SourceKitService & swift-frontend processes skyrocket their memory usage (~50+GB!). The only pattern I've been able to discern is this issue seems to occur when I copy/paste a rather large chunk of code. Xcode seems to struggle processing all of the inevitable errors contained in the logic, like vars not being declared or properties not existing for variables. As of late I've been more careful with what I've copy/pasting.