Xcode 4 变得非常慢并且耗尽了我的硬盘

发布于 2024-11-14 05:35:43 字数 566 浏览 2 评论 0原文

我的机器有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

隐诗 2024-11-21 05:35:43

更新:

解决方案是使用 #import "header.h" 语句进行模拟。当你有复杂/循环的导入结构时,Xcode 看起来需要大量的处理能力来进行智能感知(通过性能工具追踪 - Xcode 陷入无限递归函数调用循环)。 当我将尽可能多的导入移动到实现文件并在标头中使用前向声明时,问题就消失了。

这是我之前尝试过的:

  1. 重新安装(通过以下方式完全删除:
    须藤
    /开发人员/库/uninstall-devtools
    –mode=al) 并安装新版本
    4.0.2 - 根本没有帮助。无论如何 - 它真的完全删除了吗,因为我的主要自定义 Xcode 首选项设置仍然存在)?
  2. 碎片整理(iDefrag - 通过重建 B 树和元数据进行完整碎片整理)- 完全没有帮助。
  3. 系统清理和防病毒扫描 - CleanMyMac、MacKeeper - 完全没有帮助。
  4. 组织者 - 存储库 - 清理了所有存储库(我使用 Git 和 Xcode 出于其自身原因以某种方式将列表存储在那里,即使我只使用命令行来管理 Git) - 小改进。
  5. 组织者 - 项目 - 清除列表中除打开的项目之外的所有项目 - 小改进
  6. 文件 - 源代码管理 - 禁用显示远程状态(以某种方式启用,感谢 ThomasW 指出这一点),但没有太大帮助。
  7. Xcode - 首选项 - 常规 - 禁用自动保存(仅提示)和两个实时问题(在编辑器中,在问题导航器中) - 相当多的改进。
  8. 关闭实用程序面板和快速帮助窗格- 最大的进步!。我终于又可以流畅打字了!真是一个惊喜。这样一个简单的解决方案。看起来帮助索引/搜索助手简直太糟糕了!为什么它不在后台进行查找或其他操作?

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:

  1. Reinstalling (complete removal by:
    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)?
  2. Defragmentation (iDefrag - full defragmentation with rebuiling B-Tree and Metadata) - Did NOT help at all.
  3. System cleaning and antivirus scanning - CleanMyMac, MacKeeper - did NOT help at all.
  4. Organizer - Repositories - cleaned all repositories (I use Git and Xcode somehow stores list there for its own reasons even if I use only command line to manage Git) - small improvement.
  5. Organizer - Projects - cleaned all Projects from the list except opened ones - small improvement
  6. File - Source control - disable Show Remote Status (was enabled somehow, thx to ThomasW for pointing to that), but did NOT help much.
  7. Xcode - Preference - General - Disable Auto-Save (prompt only) and both Live Issues (In Editors, In Issue Navigator) - quite a bit of improvement.
  8. Closed Utility Panel and Quick Help Pane - the biggest improvement! . I can finally type smoothly again! What a surprise. Such a trivial solution. It looks like help indexing / search assistant simply sucks! Why it does not do lookups in the background or something?

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.

揽月 2024-11-21 05:35:43

我在使用 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.

拔了角的鹿 2024-11-21 05:35:43

以下内容对我帮助很大 - 清除工作区文件。

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]

痴梦一场 2024-11-21 05:35:43

不,这不正常。我使用的是 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.

屋顶上的小猫咪 2024-11-21 05:35:43

对我来说,故事板几乎无法使用,直到我单击视图控制器,然后单击“编辑器 - 解决自动布局问题 - 清除视图控制器中的所有约束”。

我一直在尝试修复布局问题,并且还切换了约束工具栏(故事板窗口右下角)中的 [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%.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文