IOS – Xcode 7 performance issues

ideiosxcode

Does anyone know how to improve xcodes memory performance. With iOS9 the mem usage jumps to ~4gb i have a macbook pro i5 2.3 8gb But this damn thing is eating everything! At times it takes 2-3 min to switch between swift files or move to another location in the same file.

If i switch to another program (Chrome, slack or skype) those run perfectly fine.
After some monitoring with Instruments i saw the following (Simulator running)

  • After running it for 20min or so the issue also occurs on Instruments
  • I have regular spikes of cpu usage of up to 106% (Not to sure how
    that works)
  • I got the iOS 8.4 simulator to see if 9 was specifically causing the issue, issue still persists.
  • xcode virtual mem is 5gb
  • xcode real mem stays between 500-750mb and has the occasional jump to ~1gb
  • xcode compressed mem is ~350mb
  • xcode threads climbs to about 32/34 when the issue occurs

Exact issue description
At random intervals(cannot find exact replication steps) xcode will apear to "hang" i am unable to switch between files or scroll on any pane (code, file structure or overview).
Also if I switch to another application while this is happening and switch back xcode will not come into view.
This can occur when xcode or the simulator is not in view.
There doesn't seem to be anything downloading in xcode or on the system.

Best Answer

I can't comment but I am running into the same issue with xcode and have a direction for you to try. Create a new profile on your mac and run xcode from there and check the memory usage for xcode, that should hopefully be down around normal levels. What that means i'm not sure yet, but it could help.

Update:

My problem was caused by too many provisioning profiles, this wasn't an issue I can recall from pre Xcode7, but maybe someone else can enlighten me. Any time any project was opened something happened that cause my xcode usage to spike up to 5.2GB uncompressed, but deleting about 1.5GB of provisioning profiles brought that usage back down to normal levels as described in this thread.

To find the files to delete go to:

${Your_Username}/Library/MobileDevice/Provisioning\ Profiles