I'm trying to develop a very simple app using Xcode. The app was able to build and run in a simulator last week. But, now Xcode (and two process it starts: swift-frontend and SourceKitService) just start using more and more memory (20GB - 30GB each) until the Mac crashes or hangs. I'm using Xcode 13.1, Mac Big Sur 11.6, 57G free storage in Mac I've uninstalled and reinstalled Xcode with no change in behavior.
Xcode crashing Mac
Is it a SwiftUI code ? According to this post:
https://developer.apple.com/forums/thread/691415,
there is a problem with Xcode 13. And Swift team now aware of it.
You should file a critical bug, to hopefully speed up correction.
In the meantime, you may have to revert to last Xcode 12 (12.5.1 that you can download here: h t t p s : / / xcodereleases.com)