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.
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:
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)?
Defragmentation (iDefrag - full defragmentation with rebuiling B-Tree and Metadata) - Did NOT help at all.
System cleaning and antivirus scanning - CleanMyMac, MacKeeper - did NOT help at all.
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.
Organizer - Projects - cleaned all Projects from the list except opened ones - small improvement
File - Source control - disable Show Remote Status (was enabled somehow, thx to ThomasW for pointing to that), but did NOT help much.
Xcode - Preference - General - Disable Auto-Save (prompt only) and both Live Issues (In Editors, In Issue Navigator) - quite a bit of improvement.
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.
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.
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]
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.
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%.
Related
Have anyone tried out the new Color Asset Catalogue feature in Xcode 9. For me every time I edit something on this like adding or editing a colour asset, I have to wait for 10-15 seconds while Xcode shows the coloured progress and does not allow any interaction.
At the same time being highly annoying, it is also highly counter-productive. I also found IB to be generally too slow after updating to Xcode 9.
Are these known issues ? Is there a solution to this?
i asked apple about the hangs and crashes that keep on occurring on Xcode 9, and they replied:
First, quit Xcode. And then temporarily move aside
UserInterfaceState.xcuserstate so that new user state is created.
It can be found here
path_to/$WORKSPACE.xcworkspace/xcuserdata/$USER.xcuserdatad/UserInterfaceState.xcuserstate
(if it is an .xcodeproject, it will be deep in the project.xcworkspace
directory).
this worked for me with autocomplete problems and switching between files. hope it helps you out as well.
Xcode 9 is borderline unusable for me too at times. The worst is how long it takes to open/edit a storyboard file and also run the simulator. Even autocomplete and switching between code files is lagging a lot for me, much more so than past versions. I imagine Apple knows about it considering the Apple development forums are full of threads about how the newest update is unacceptable but as for how long it will take for them to do anything about it, who knows. It's an absolute nightmare for iOS developer's productivity to say the least.
My solution is to just quit Xcode when it starts getting too slow. It's a pain, obviously, but usually helps short term.
I've got a relatively small project written in ASP.NET MVC3. After working a while, Visual Studio 2010 becomes very slow in Razor views (other file types work fine). With "slow" I mean "every keystroke takes around 1 second to register". It doesn't matter what that keystroke was - typing a single letter is as slow as pasting a screenful of markup. During this slowdown VS2010 consumes 1 CPU core to 100%. After I restart VS2010, everything goes smoothly again for a small while. This happens in any and all Razor views.
My PC isn't the best, but it should be enough: Core 2 Duo 6700, 4GB of RAM (currently only 75% filled with VS2010 being slow and all, so it's not a RAM shortage), Windows 7 x64.
The project is close to an end, and I remember that for most time there were no problems. This has started only recently, although I cannot imagine what could have caused it.
Does anyone have any ideas about what could be wrong and what could be done to fix it?
It is plugins - TFS/AnkvSVN and ReSharper have all caused problems for me.
Turn them off one by one, to discern which one (if only one) is causing you grief.
When you find the culprit, make sure you keep up on any patches with it.
In extreme cases, turn if off if you have a long development session and don't need it the whole time (SVN for instance could be turned on when you are ready to do commits and check ins, etc.)
The issue is resolved for me, by installing the Mvc Html5 Templates.
After the installation, I picked XHTML5 and then back HTML5 from the "Target schema" combo box. After that, the paste was instant!
Edit: I uninstalled "Mvc Html5 Templates" and the issue didn't reappear. Perhaps it has something to do with the "HTML 5 Intellisense"
Have you installed sp 1 it fixed some performance related issues when loading IntelliSense for markup
Run the Resource Monitor (CTRL+SHIFT+ESC, click Performance tab then Resource Monitor button at the bottom). Pay special attention to disk I/O and perhaps CPU usage.
Sort disk I/O by Total B/Sec descending. As you type, see if it can identify a process which is causing the issue. Hopefully it's a virus scanner or some other famous performance destroyer and not the Visual Studio process itself, which wouldn't be very helpful.
Have you tried opening the same project on a different machine? This will give you an idea whether issue is in the project or VS install. Quite obvious, but is there anything in the event viewer. Are you connected to a domain while this is happening?
Well, for me the problem has turned out to be anti virus - we use (or are made to suffer) Sunbelt Vipre on our workstations and as soon as I switch off active protection (so that's basically disabling AV completely) all of a sudden all the performance issues in all windows are gone.
Sorry for adding another answer, but there seem to be lots of different causes, so - lets list all possible fixes here.
I tried disabling ReSharper and other addons - did not work. What did work - is reapplying the SP1 again.
PS. Weird, I know. Don't ask, no idea... My guess is - VS was "repairing" itself silently at some point and restored some non-SP1 components.
PPS. You might also want to try disabling "Productivity Power Tools" addon. If you have ReSharper installed - almost all the PPT features are already there, in ReSharper.
PPPS. I have a blog post with several performance tips for Visual Studio & ReSharper, might come handy..
Have you tried Cleaning the solution?
In my case, high CPU usage started out of nowhere (WPF project). Restarts of Visual Studio didn't help, neither disabling/uninstalling addons. But Cleaning the solution did help!
I was experiencing a very similar issue on a large cshtml file in VS 2015 and was solved for me by turning off all of the automatic formatting options in Options > Text Editor > C# > Formatting > General:
I then use the "Control+K,D" key combination to format the page once I have finished making the necessary code changes.
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.
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.
Any ideas?
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?
have you rebooted?
It sounds like you have predictive compilation turned on in the Xcode preferences.
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.
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.
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.
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.
So if something like this starts right when you start editing a file, try commenting out the problem areas and trying again.
I have just upgraded to VS 2010, and I have performance problems which I did not have before (in VS 2008).
The most annoying thing is that it freezes while I work in the text editor. Sometimes when it freezes I see that it is saving auto recovery information, but not always.
Almost anything I do gives an unacceptable long delay, like saving, starting to debug, ending debug session, switching between design and code view, and doing WinForms designing.
I have some parts of my home directory on a mapped network drive. I suspect that that might be a part of the problem. Is it possible to configure VS 2010 to use exclusively local disk for its "internal" work perhaps?
Any hints would be appreciated! Has anyone else experienced these kinds of problems?
Edit:
I forgot to give my specs:
Win 7 64-bit
4 gb memory
No addins, just standard installation
The project folder is on the network drive
One interesting thing is that I feel that I have better performance in a VM running XP (where the VM runs on the same PC).
VS is great if you do what microsoft recommends and work on a local copy of your projects.
As soon as you start tying to open projects in remote locations you will get this issue.
Recommendations:
use a source control solution.
create a copy of your project locally and run the solution from that.
Also ...
I think it does it's clever stuff in the background, I found the more i use it the faster it gets, especially on long running projects that I regularly go back to.
If you think it might be aformentioned WPF framework you may want to try switching off aero (as a test) if it helps the problem is likely that your chosen graphics hardware is not very good at effect or 3D based output so it's struggling.
Also try reducing the number of background services and apps you have running.
on windows 7 these days 4 gigs of ram is considered standard, so whilst it should perform fine maybe consider putting more ram in if you are trying to handle large datasets / similar business applications.
Another thing you could try is run a repair install over the top of your existing, it may not have cleanly installed something ... unlikely but it may help.
If you can, buy an SSD disk and move all your projects locally.
I find VS2010 super intensive on disk.
It fly on my home machine with an SSD but it's almost unusable on my work machine(Win7 4 gig RAM, but standard disk)
Try setting the number of parallel builds to half the number of cores you have (I think its in options, settings, Solutions and Project, build and run).. I had it set to 8 which was too much.. it spawned 8 msbuild.exe, rebuilding a solution with 70 projects bottlenecked the disk when they all tried to read/writte similar pre-compiled headers. Those msbuild's stick around even after you close the IDE.
Also I disabled the gather browsing info for implicit files, which made intellisense parsing quicker.
An old post I know, but in case it helps others (as the previous answers focused on source code)...
I found that it wasn't my source code that was the issue, that was held locally along with all the references, but the default locations (project, project templates and item templates) as these were held on a networked drive. These can be altered in the Tools -> Options -> Projects and Solutions.
Alternatively you could change the frequency of the saves or turn them off altogether via Tools -> Options -> AutoRecover
I like ReSharper, but it is a total memory hog. It can quickly swell up and consume a half-gig of RAM without too much effort and bog down the IDE. Does anybody know of any way to configure it to be not as slow?
Turn off the on-the-fly compilation (which, unfortunately, is one of its best features)
The next release 4.5 is going to based around performance and memory footprint.
see Ilya Ryzhenkov's blog
Resharper 4.5 has been released
From my experience it is less of a memory hog, but i still can run out of memory.
I had an issue where it was taking upwards of 10 minutes to load a solution of 100+ projects. Once loaded VS performance would be ok, though it would oddly flutter back and forth between ok and really bad.
The short answer: Eliminating Resharper warnings seems to improve overall VS/R# performance.
The biggest problem ultimately was that we had a number of files of binary data (encrypted stuff) being included as embedded resources, which happened to have .xml extensions. Resharper was trying really really hard to analyze those files. Eventually it'd get through but would generate 100K+ errors in the process. Changing the extension to one Resharper did not automatically analyze (.bin in this case) solved the problem.
We still have about 10 files which when they or a file they depend on is edited performance tanks for a while. These files are the partial parts of a single class definition where each file averages 3000 LOC. Yes, that's right, it's about a 30K line class. It also happens to be rather poor code for other reasons, many of which Resharper flags making the right hand gutter bar practically a solid orange line. Editing often causes Resharper to reanalyze the whole thing. While that analysis runs, performance is noticeably affected.
I've come to the conclusion that the less errors/warnings there are for R# to identify, the better it performs. My anecdotal evidence gathered while cleaning up/refactoring this project seems to support it.
A lot of folks complain of perf problems with Resharper. If you have even a few big ugly code files with lots of Resharper warnings, then a little time spent cleaning that code up might yield better performance overall. It has for us.
Not sure how big your solutions are, but I stopped using 4.5 for the same reasons I stopped using all previous versions, memory usage.
Code analysis and unit test support was the main reason I bought it, turning it off means the rationale for using it is gone.
Workstation has 4GB of memory, and I can easily kill it with ReSharper when running our end-to-end stack in debuggers.
You can look how much memory ReSharper use.
ReSharper -> General -> Show managed memory usege in status bar.
If you are working on large source files, Resharper does get sluggish (I'm working on version 5.0 at the time of writing this).
You can view the memory usage of Resharper by clicking on Resharper options -> General -> Show memory use in status bar.
When I first did this, I noticed Resharper had clocked up hundreds of megabytes of memory usage! However, the next step worked for me in (temporarily) fixing the slugishness:
Right click the memory usage, and select "Collect garbage" - this seemed to fix the slugishness for me straight away.
Regarding memory hogging - I've found that my VS2008 memory footprint grows every time I close one solution and open another. This is true even if I close a solution and re-open that same solution.
The new ReSharper 4.5 works a lot better than the previous 4.x releases. I would recommend you try that one.
In previous versions I had the same problem, when 4.0 came out these problems have seemed to have gone away. Now with 4.1 i do not feel the huge slow down i used to have. My IDE does not freeze up anymore.
have you tried upgrading ?
Try the 4.5 beta. 4.1 was killing my 2GB dev machine, but it's back to running incredibly smoothly with the beta. Others have had the opposite experience, though, so YMMV.
Yes, 4.5 works much better. My understanding is that 4.5 was to address the performance issues.
Me and my colleagues are also having huge performance issues with ReSharper, just now my ReSharper took 1.1GB of memory. Visual Studio slows down specially when writing JavaScript, it's unbearable. You can turn of the on the fly compilation, but it's the best feature it has...
edit: Everybody in this thread seems to have ReShaprper 4.x, my version is 6.0.