Xcode 4 变得非常慢并且耗尽了我的硬盘
我的机器有 8 GB 或 RAM,Core 2 Duo 3,06 GHZ,似乎不足以支持 Xcode 4 (4.0.1)。 从现在开始,它的行为开始变得越来越慢。自动完成、编辑代码以及 Xib 文件几乎无法使用。
其他应用程序运行顺利。
活动监视器显示大量 RAM 使用情况(完全可用的内存还剩下几 GB,所以还不错)和巨大的磁盘活动使用情况。当我在 Xcode 中工作时,我可以在图表上看到定期保存的数据高峰。经过 3 小时的工作,已有 10.5 GB 的数据写入磁盘。正常吗?
我尝试过禁用自动保存,但没有多大帮助。
Xcode 4 运行速度极慢的其他原因可能是什么?
它从一开始就没有这样的行为,而且在 Xcode 索引期间也不是这样。更有趣的是:当 Xcode 在清理后对我的项目进行索引时,它比索引完成时消耗的 CPU 功率更少(CPU再次索引后会上升)。呵呵?
更新: 完全重新安装 Snow Leopard(到已清理的磁盘)以及 Xcode 并没有多大帮助。 Xcode 在一天左右的时间内工作得很好,然后又变慢到几乎无法使用的程度。
My machine has 8 GB or RAM, Core 2 Duo 3,06 GHZ and it seems it is not enough for Xcode 4 (4.0.1).
From some time now it started to behave more and more slow. Auto completion, editing code as well as Xib files became almost impossible to use.
Other applications behave smoothly.
Activity monitor shows a lot of RAM usage (still few GB left of completely free memory, so it is quite OK) and huge disk activity usage. I can see on the graph high peaks of data being saved periodically when I work in Xcode. After 3 hours of work there is 10.5 GB of data written to the disk. Is it normal?
I have tried to disable auto-save but it did not help much.
What can be the other causes of this extremely slow behavior of Xcode 4?
It did not behave like this from the beginning and it is not during Xcode indexing. To be even more interesting: when Xcode is indexing my project after cleaning it takes less CPU power than when indexing is done (CPU raises up after indexing again). Heh?
UPDATE: Complete reinstall of Snow Leopard (to the cleaned disk) together with Xcode did not help much. Xcode was working quite well just for a day or so and then slowed down again to the degree it is hardly possible to work with.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
更新:
解决方案是使用 #import
"header.h"
语句进行模拟。当你有复杂/循环的导入结构时,Xcode 看起来需要大量的处理能力来进行智能感知(通过性能工具追踪 - Xcode 陷入无限递归函数调用循环)。 当我将尽可能多的导入移动到实现文件并在标头中使用前向声明时,问题就消失了。这是我之前尝试过的:
须藤
/开发人员/库/uninstall-devtools
–mode=al) 并安装新版本
4.0.2 - 根本没有帮助。无论如何 - 它真的完全删除了吗,因为我的主要自定义 Xcode 首选项设置仍然存在)?
Xcode 仍然很慢,但现在几乎可以使用生产质量性能。无论如何,Core 2 Duo 3,06Ghz / 8BG DDRIII Ram / Momentus XT SS Hybrid 很难做到这一点是相当遗憾的。因此,我非常接近购买 OCZ Vertex SSD 或其他一些超级额外的 SSD。
UPDATE:
The solution was to mock around with #import
"header.h"
statements. It looks like Xcode requires a lot of processing power for intellisense when you you have complicated / circular imports structure (tracked down by performance tools - Xcode was falling into infinite recursive function call loop). When I moved as many imports I could to the implementation files and used forward declarations in headers, the problem went away.This is what I have tried before:
sudo
/Developer/Library/uninstall-devtools
–mode=al) and installed new version
4.0.2 - Did NOT help at all. Anyway - Is it really complete removal as my main custom Xcode preference settings has survived)?
Xcode is still slow but now it is almost possible to work with production quality performance. Anyway it is quite a shame that Core 2 Duo 3,06Ghz / 8BG DDRIII Ram / Momentus XT SS Hybrid can hardly make it. I was so close to buy OCZ Vertex SSD or some other super extra SSD because of this.
我在使用 Xcode 4 时遇到了性能问题,我追踪到文件 -> 源代码控制 -> 显示远程状态功能正在打开。关闭该功能对我来说很有效。
但是,如果这不是问题,那么您应该在 Xcode 出现性能问题时对其进行采样。使用命令行或活动监视器应用程序。这可能会让您了解问题所在。如果没有,则将示例发布到此处。另外,请通过示例向 Apple 提交错误。
I was running into performance problems with Xcode 4 and I tracked it down to the File->Source Control->Show Remote Status feature being on. Turning that feature off did the trick for me.
However, if that is not the issue then you should take samples of Xcode while it is having the performance issues. Either use the command line or the Activity Monitor application. This might give you a clue as to what the issue is. If it doesn't then post the sample here. Also, submit a bug to Apple with the sample.
以下内容对我帮助很大 - 清除工作区文件。
Xcode 4 - 性能缓慢
我没有下载他们正在谈论的小程序,只是手动下载到目前为止,这样做非常有效......
[更新:更正了链接]
The following helped me A LOT - purge the workspace file.
Xcode 4 - slow performance
I didn't download the applet they're talking about but just manually doing it is working very effectively so far...
[Update: corrected the link]
不,这不正常。我使用的是 MACbook Pro,它运行得非常正常,不会比任何其他应用程序消耗更多的 RAM。有时它会占用一些 CPU 和 RAM,但重新启动后又会恢复正常运行。我将其归因于 XCode 4 在重建后仍然很新。
如果您遇到这种情况,我建议完全卸载 XCode 和所有开发人员工具。确保您已获取 SDK 和所有内容。重新启动。然后重新安装看看是否有改善。
哦,我的所有项目都使用 Git。
No this is not normal. I use a MAcbook Pro and it works quite normally, not sucking any more RAM than any other app. Occasionally it chews some CPU and RAM, but s restart and it's back to behaving. I put that down to XCode 4 still being quite new after the rebuild.
If you are getting this sort of behavior, I'd suggest completely uninstalling XCode and all developer tools. Make sure you get the SDKs and everything out. Reboot. Then reinstall and see if it improves.
Oh, and I use Git for all my projects.
对我来说,故事板几乎无法使用,直到我单击视图控制器,然后单击“编辑器 - 解决自动布局问题 - 清除视图控制器中的所有约束”。
我一直在尝试修复布局问题,并且还切换了约束工具栏(故事板窗口右下角)中的 [3.5" / 4" Retina] 按钮。
一旦我清除了这个,Xcode 性能就恢复到 100%。
For me, Storyboard was almost unusable until I clicked on the View Controller and then "Editor - Resolve AutoLayout Issues - Clear All Constraints in View Controller".
I had been trying to fix layout issues and was also toggling the [3.5" / 4" Retina] button in the constraint tool bar (lower-right of the Storyboard window).
Once I cleared this, Xcode performance was back to 100%.