I have a small project that takes ages to get indexed and uses ridiculous amounts of memory while indexing. In the screenshot you can see two Swift processes using 160+ GB of memory. I have this problem only in one project. btw the project uses CocoaPods.
Now if I keep an eye on the Activity monitor and keep kill the processes in time (before they take up too much memory to freeze the Mac), eventually the project is indexed and I can work on it.
What could be the cause of this memory behavior and how can I prevent it?
[Xcode Version 11.2.1 (11B500) on Catalina 10.15.1 (19B88), CocoaPods 1.8.4]
P.S. Doing the usual clean and delete derived data doesn't help at all.
For each OS, it has simulator runtimes, libraries, compilers, and software development kits. It has a ton of data about declarations supported in each operating system. That's why it's so huge.
While Xcode is open, you can rename the folder that your project is in. Just tweak it with an extra space or something, and when you get the message to close or resave. Just close the project and open it again. Xcode will then index the project.
The frontend is the part of the Swift executable that actually compiles things. This is as opposed to the driver, which looks at the set of input files and figures out what work (including frontend jobs, but also linkers and other tools) is needed to build the project.
Found it !!
I needed to remove use_frameworks!
from my Podfile (make sure you use cocoapods > 1.5.0) and add
install! 'cocoapods', :disable_input_output_paths => true
Source: https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With