Xcode 突然变得很慢
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3929718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode suddenly becomes very slow
提问by John Smith
My Xcode speed has come down to a crawl. I have no idea why. CPU activity is very low on both cores, gobs of memory.
我的 Xcode 速度已经下降到爬行。我不知道为什么。两个内核上的 CPU 活动都非常低,大量内存。
It's almost as if it's waiting for something but I have no idea what. I have disconnected all USB and FireWire devices but it helped only a little bit.
就好像它在等待什么,但我不知道是什么。我已经断开了所有 USB 和 FireWire 设备的连接,但它只起到了一点作用。
Any ideas?
有任何想法吗?
采纳答案by drekka
First thing I'd look at is the HDD. Is it constantly being accessed? If so, it would indicate several possible things - memory shortage and lots of swapping, hard drive free space shortage cause it to hunt for space, heavy fragementation etc.
我首先要看的是硬盘。它是否经常被访问?如果是这样,它会表明几个可能的事情 - 内存不足和大量交换,硬盘可用空间不足导致它寻找空间,严重碎片等。
If thats not it, perhaps Xcode is running something in the background. Do you have any custom scripts you have added which could have done something?
如果不是这样,则 Xcode 可能正在后台运行某些程序。您是否添加了任何可以做某事的自定义脚本?
have you rebooted?
你重启了吗?
回答by Peter Hosey
It sounds like you have predictive compilation turned on in the Xcode preferences.
听起来您在 Xcode 首选项中打开了预测编译。
回答by Jacob
I know this is a relatively old post, but I had a different problem that was causing XCode to be sluggish. I am running 4.1. If you navigate to your project file, secondary click and select "Show Package Contents", then delete the *.xcworkspace file, XCode speeds up drastically. No more rainbow pinwheel of death.
我知道这是一篇相对较旧的帖子,但我遇到了一个不同的问题,导致 XCode 运行缓慢。我正在运行 4.1。如果您导航到您的项目文件,再次单击并选择“显示包内容”,然后删除 *.xcworkspace 文件,XCode 会大大加快速度。不再有死亡的彩虹风车。
回答by Joshua Nozzi
It may very well be downloading documentation updates. They're fairly large. Open Xcode's (note, big X, little c :-)) preferences and go to the documentation tab. I'll bet there's a circular progress indicator beside one of the doc sets.
它很可能正在下载文档更新。它们相当大。打开 Xcode 的(注意,大 X,小 c :-))首选项并转到文档选项卡。我敢打赌,其中一个文档集旁边会有一个循环进度指示器。
回答by PinkFloydRocks
If you have lots and lots of code (or at least 10 000++ lines of code), the predictive compilation setting gets a lot to do. Turn this off as mentioned and you've at least eliminated that variable.
如果您有大量代码(或至少 10 000++ 行代码),则预测编译设置有很多工作要做。如上所述将其关闭,您至少已经消除了该变量。
回答by Dominic Holmes
For me, this just happened when I started editing a new file. It was caused by a single function -- something in that function caused the compiler to freak out. After 20 minutes of compiling, Xcode gave me that message.
对我来说,这只是在我开始编辑新文件时发生的。它是由单个函数引起的——该函数中的某些东西导致编译器吓坏了。编译 20 分钟后,Xcode 给了我这条消息。
So if something like this starts right when you start editing a file, try commenting out the problem areas and trying again.
因此,如果在您开始编辑文件时就开始出现这样的事情,请尝试注释掉问题区域并重试。