简体   繁体   中英

Xcode 5 - out of control CPU and memory usage

I've been having issues lately with the latest version of Xcode 5. About a minute or so after launching CPU usage and Real Memory usage skyrocket. I've seen CPU usage as high as 400% and RAM usage as high as 13GB.

I'm on an i5 iMac with 16GB of RAM.

I've tried uninstalling Xcode and reinstalling, running all Mountain Lion upgrades, fixing recurring header loops, launching Xcode without indexing and a few other issues all to no avail. I'm now at a loss as to what I can do.

运行Xcode几分钟后的Activity Monitor。没有编译或任何东西

I would love suggestions of things to try. I've tried running my project on other i5 iMacs and I don't have this issue.

Thanks everyone.

I had this exact problem over the weekend with my Macbook Air and Xcode5. I tired resetting Xcode back to default, deleting the iOS simulator files, etc.

I've isolated it to it being the Source Control functionality in XCode. The high CPU usage doesn't seem to happen when the affected Project is not open, (Close everything and start a new Xcode project). I've disabled Source Control within XCode and and started using GitX instead, and CPU levels for XCode has dropped back to normal levels (5 - 15%).

I haven't dug deeper into XCode to see what could have triggered it.

I was running at 120% - beachball almost constantly - while idle.

What dropped me down to 1.3% was unchecking "Refresh local status automatically" in the "Source Control" tab in Xcode Preferences.

You can still have "Enable Source Control" and "Refresh Server Status Automatically" and "Add and remove files automatically"

I've submitted a couple bug reports regarding this and while debugging it we came to a conclusion it seems to happen with upgraded projects. By simply removing all the classes from my project then reading them I no longer experience the horrible cpu usage and ram usage. This was primarily happening on 5.0 with my storyboards prior to simply removing them and re-adding them to the project. Xcode 5.0.1 also helped my performance.

*UPDATE Since updating to Xcode 5.0.2 I no longer see these issues. I can finally work on large storyboards again.

I have actually figured out the cause of this memory issue in the source that I have, it was because one of the 3rd party library used was giving a lot of warnings and may be xcode is trying to do some processing around that. Just for test purpose, I removed the library and some of the classes which used that, and I was able to build the code faster. Now I plan to get to the bottom of the warnings and try to fix it. Not sure if all the people facing these issue is because of this but this was definitely the reason for my problem.

您是否尝试同时访问多个库,或者您是否通过系统搜索Xcode文件或项目?这有时会带来您遇到的问题。在xcode中同时运行这么多功能可以带来这些类型的问题。如果您可以在备份所需数据后重新安装xcode。

I just experienced similar issues with xcode after an update yesterday.

My memory on a 16GB macbook pro just dried out every time I opened xcode from 11-12gb of free ram to somewhere between 3-4gb with or without any projects open. I tried deleting the DerivedData folder to no avail.

The only solution that I have found that fixes the issue temporarily is for me to let xcode eat all the memory after starting and then doing a sudo purge in terminal.

After the purge I can work as normal with xcode with any projects using only as much ram as it needs to, but this needs to be done every time I start xcode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM