Xcode 运行缓慢并占用 CPU
很多时候,Xcode(看似随机)开始运行得非常慢——在 IB 中移动对象可能需要大约 15 秒,或者在更改一行代码后进行编译仍然可能需要长达 10 秒的时间。我查看了我的活动监视器,这是我发现的:
我的问题是,是这正常吗?
Lots of times Xcode (seemingly randomly) starts to run extremely slowly- it can take around fifteen seconds to move an object in IB, or compiling after changing one line of code can still take up to ten seconds. I took a look at my Activity Monitor, and this is what I found:
My question is, is this normal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
即使对于最新版本的 Xcode,2GB RAM 也绰绰有余。
看起来您遇到了 Xcode 编译/索引/语法高亮中的错误之一。 cf: Xcode 4.3.2 和 100 % CPU持续处于空闲时间
2GB of RAM is way more than enough, even for latest versions of Xcode.
Looks like you've hit one of the bugs in Xcode compilation / indexing / syntax hilighting. c.f.: Xcode 4.3.2 and 100% CPU constantly in the idle time
你只有 2GB 的 RAM。随着苹果软件的每次更新,它们都会占用更多的内存。 Safari 5.1+ 也是如此。所以回答你的问题,是的,对于运行 Lion 以及其他内存密集型应用程序(Chrome 是另一个)的 2GB RAM 的机器来说,这是正常的。
至于Interface Builder,我也注意到了这一点。 XIB 是 XML 文件,所以我相信当您移动对象时,Interface Builder 会在移动对象时在视图上写入它的位置,因此这也是一项数据量很大的任务。
You only have 2GB's of RAM. With each update to Apple's software, they get more memory intensive. The same goes with Safari 5.1+. So to answer your question, Yes, this is normal for a machine with 2GB's of RAM running Lion as well as other memory intensive applications, Chrome being another.
As for Interface Builder, I have noticed this too. XIB's are XML files, so I believe as you move an object, Interface Builder is writing it's location on the view as it is moved, so that is a very data heavy task as well.
XCode 通常有大约 20-30% 的 CPU 坐在后台什么都不做。就是一头猪,仅此而已。
XCode is usually around 20-30% CPU sitting in the background doing nothing. It's a pig that's all.