title: Xcode indexing takes ages and uses gigabytes of memory
body: <p>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. </p>
  
  <p>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.</p>
  
  <p>What could be the cause of this memory behavior and how can I prevent it?</p>
  
  <p>[Xcode Version 11.2.1 (11B500) on Catalina 10.15.1 (19B88), CocoaPods 1.8.4]</p>
  
  <p>P.S. Doing the usual clean and delete derived data doesn't help at all.</p>
  
  <p><a href="https://i.stack.imgur.com/6dDLB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6dDLB.png" alt="ridiculous"></a></p>