Xcode 4.3.2和100%CPU始终处于空闲状态 [英] Xcode 4.3.2 and 100% CPU constantly in the idle time

查看:171
本文介绍了Xcode 4.3.2和100%CPU始终处于空闲状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Xcode从昨天开始在处理中等大小的项目(大约200个源文件)时表现异常。项目可以正确编译,并且可以在模拟器和设备中运行。我不使用任何第三方库,除了很少使用的第三方库(例如JSON或facebook ios sdk)。



它始终以全速使用CPU,甚至如果它处于空闲状态(无索引,无编译,无编辑)。 RAM的使用是相对正常的(300-50MB)。



我的机器使用:Core 2 Duo 3.04Ghz CPU,8GB RAM和Vertex OCZ 3 SSD驱动器。 / p>

我已经尝试了在stackoverflow上找到的所有建议解决方案:


  1. 已清理项目

  2. 在Organizer中清理导出的数据

  3. 在Organizer中清理干净的存储库

  4. 按照建议从工作区和userdata文件中清理xcodeproject包此处: https://stackoverflow.com/a/8165886/229229 (它只是暂时起作用,然后又重新开始一分钟左右后。)

  5. 多次重新启动Xcode(与4中的效果相同)。

  6. 禁用实时问题

  7. 甚至重新安装了Xcode

没有任何帮助。在大多数情况下,Xcode会暂时索引项目,然后恢复到正常性能,但过一会又变得不可用。两个内核的CPU都跳回95-100%,智能挂起等...



我附上了仪器如何看待Xcode进程的屏幕截图: / p>







更新:
希望片刻之后,我可以通过移动几个来解决问题。



#import header.h



语句从标头到实现文件,并与前向声明交换它们……问题又过了一会儿再出现。
我正在添加控制台日志。
奇怪的是,与Xcode相关的日志是在我退出后显示的,而不是在运行itef的过程中显示的。



控制台日志:

  12/5/11 9:27:03.777 AM [0x0-0x45045] .com.apple.dt.Xcode:com.apple.dt。 instrument.backgroundinstruments:已加载
12/5/11 9:27:05.571 AM Xcode:性能:请更新此脚本添加为每个事件处理程序提供ThreadSafe的值: /Library/ScriptingAdditions/SIMBL.osax
12年5月11日9:27:58.168 Xcode:错误:无法基于默认值为ID启用创建警报:1


解决方案

阻止我噩梦的是:


  1. 在项目构建设置中将始终搜索用户路径更改为NO(强制)。

  2. 删除-objC标志其他链接器标志(也为粗体设置)。

,然后删除派生数据,等到Xcode重新索引。



我不确定其中哪个帮助了我ch同时使它们变老了,我的进度太晚了,我没有时间进行测试。当我在业余时间重现错误和解决方案时,我会改善这个答案。



但是,有一个提示:
* 重新考虑并重新检查您的项目/目标构建设置。 *



这种奇怪的行为很可能是是由于某些不幸的构建设置组合造成的。


My Xcode started to behave very heavily from yesterday when working on medium size project (around 200 source files). Project compiles correctly and runs in both simulator and device. I do not use any 3rd party libraries, except few widely used includes (like JSON or facebook ios sdk).

It constantly uses CPU(s) at full speed, even if it is in idle state (no indexing, no compiling, no editing). The usage of RAM is relatively normal (300-50MB).

My machine uses: Core 2 Duo 3.04Ghz CPU, 8GB of RAM and Vertex OCZ 3 SSD drive.

I have tried every suggested solution found at stackoverflow:

  1. Cleaned project
  2. Cleaned Derived Data in Organizer
  3. Cleaned repositories in Organizer
  4. Cleaned xcodeproject bundle from workspace and userdata files as suggested here: https://stackoverflow.com/a/8165886/229229 (it is helping just for a moment and starts again after minute or so).
  5. Restarted Xcode many times (with the same effect as in 4).
  6. Disabled "Live issues"
  7. even Reinstalled Xcode

Nothing helps. In most cases, Xcode indexes the project for a moment, then comes back to the normal performance, but after a while becomes unusable again. CPU jumps back to 95-100% for both cores, intelligence hangs, etc...

I am attaching screenshots of how the Xcode processes are seen by the Instruments:

UPDATE: After a moment of hope that I solved the problem by moving around few

#import "header.h"

statements from headers to the implementation files and exchanging them with forward declarations ... the problem came back again after a while. I am adding the console log. The strange thing is that the logs related to Xcode show up after I quit it, not during the run itsef.

Console logs:

5/11/12 9:27:03.777 AM [0x0-0x45045].com.apple.dt.Xcode: com.apple.dt.instruments.backgroundinstruments: Already loaded
5/11/12 9:27:05.571 AM Xcode: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/SIMBL.osax"
5/11/12 9:27:58.168 AM Xcode: ERROR: Failed to create an alert for ID "enabled" based on defaults: 1

解决方案

What stopped my nightmare was:

  1. Change Always Search User Path to NO in Project build settings (bolded).
  2. Remove -objC flag Other Linker Flags (also bolded setting).

And then delete Derived Data and wait until Xcode reindexes.

I am not sure which of them helped bacause I changed both of them at the same time and I am so behind my schedule I have no time to test it. I will improve this answer when I reproduce the bug and solution in spare time.

However, there is a hint: *Rethink and recheck your project / targets build settings.*

It is highly probable that this strange behavior may be caused by some unfortunate combination of build settings.

这篇关于Xcode 4.3.2和100%CPU始终处于空闲状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆