Xcode uses 16 gigs of RAM in 2 minutes - xcode

I'm working on a big project and I have some serious problems with Xcode RAM management. In the informative app I'm working on I have over 90 UIVIewControllers on my storyboard. Once I open my project and go to my storyboard file (just changing labels, zooming in and out etc') it takes less than 2 minutes for Xcode to go from 400MB usage to 8 gigs.
This will only happen while I'm using the storyboard.
This never happened to me in other apps I've managed so I believe it got something to do with the size of this app.
The above was on a new MacBook Pro. To test things out I tested it on a Mac Pro with 16 gigs of RAM. First run, same issue. 16 Gigs of ram is used after less than 2 minutes.
Things I've tried:
Deleting DerivedData (the issue is on 2 different machines so it can't be it but tried it anyway)
Deleting project.xcworkspace
Read about stoping indexing BUT without autocomplete and quick help I'll have nothing to compile anyway
I'm using Xcode 4.6.3

sounds like it is a problem with that version of Xcode. I am using 4.6.3, and have never experienced this, (although the apps I work on are never that big). You should definitely try Xcode 5, even if you cant submit to the appstore, at least you'll be able to work on your app. Then you MIGHT be able to open it in version 4.6.3, and submit it from there, not quite sure it will work, but its worth a shot. Make sure you keep a copy of what you have so far incase your Xcode 5 version wont work in 4.6.3, so you dont loose your work. hope this helps.

Related

Xcode 7 slow and sluggish

Since upgrading to xcode 7 and greater, the performance of xcode is terrible. When I click on a class or scroll the code pane it sometimes takes up to 30 seconds before reacting and often I need to force quit xcode and restart.
I have turned off source control and I am not using swift.
I have a new macbook pro with 8gb memory and an SSD. my computer is fast and has no other performance issues.
-UPDATE-
I have cleared derived data and am not using any unusual plugins
Does anyone know what may be the problem? I imagine some build setting is causing this but im not sure which.
The issue is totally with xcode 7.
try to commit/save every time you make some changes, it will increase some performance

xcode 5, Mountain Lion: Very slow performance

Installed Mountain Lion and Xcode5. Tried to open a project recently developed for iOS6. And now xcode is dramatically slow. Any ideas whats wrong with him now?
EDIT
It works fast with new projects I create. It slows down only when I open the old projects.
Ok. I found the problem. The screen attached.
When I switch 'Opens in' to Default 5, Xcode changes the UI Presentations to ugly iOS7 design and xcode suddenly starts work fast like in good old times. Switching back to 4.5 brings the very slow performance back. Thats it guys!
It reminds a problem I had with xcode 5 ( also mountain lion), the typing was very slow..
what help to fix this was removing all breakpoints ( I had nice and big list of breakpoints)
It seems to be keeping previous windows open too, so the more you switch between source files or XIB's, the more it will lag. I didn't check the memory use, but maybe it's running me out of RAM since I have a limited amount free with my Windows VM running. Quite annoying, but it works for me to close and reopen Xcode when this starts happening.

Very slow tab switching in Xcode 4.5 (Mountain Lion)

I recently updated my MacBook Pro (2.3 GHz Intel Core i5) from Lion to Mountain Lion and simultaneously upgraded Xcode to the latest 4.5 version. I've experienced one very irritating problem. While programming I'm used to have a couple of tabs opened at a time. Ever since I updated, each time I switch tabs, Xcode freezes up for a bit (a couple of seconds). Does anyone have a suggestion to solve this problem?
I followed a tip on deleting project.xcworkspace to improve performance. Which seamed to help, but only for a short period of time.
It's a common issue and was fixed in XCode 4.5.1.
https://devforums.apple.com/thread/167765?tstart=0
If you have multiple partitions (maybe a backup of Lion was kept) ensure that xcode really comes from the Mountain Lion partition.
The App Store App update for Xcode seems to take the first Xcode.app it finds and will apply any update to that version. In my case it updated the (inactive) Lion partition, even so I booted from the ML partition.
xcode-select did not complain when I tried to change it to the ML version.
So I ended up doing the great housekeeping:
do a chmod 000 /Volume/<old Lion partition>/Applications/Xcode.app
installed a fresh copy on Xcode.app into /Applications
verify the destination of the dock icon (must point to the ML Xcode.app)
My Xcode is now fast as before and it remains fast. You can get the Xcode dmg and the command line tools from https://developer.apple.com/downloads/index.action. I don't think there is a difference in the binaries, but with the DMG I could see where I dropped the Xcode.app.
I found your question before I discovered a partial solution.
As of today, I find XCode 4.6.1 GUI dog slow for my taste, specially considering that I run on a one year old mac, SSD, compile to a 2GB RAM disk and still have 6GB RAM left. Even Eclipse runs lightning fast compared to XCode
4.5.1 did improve something, but after a long time using XCode I do not have any hope for some of its problems being solved ever.
That being said, I have noticed that "Live issues", the main tool bar and all the panels slow down tab switching to same degree. The biggest offender so far are the navigator panels.
Once I got used to a minimalistic Xcode window, layout some specific task tabs, keep a separate window for xibs and learned the shortcuts to enable/disable the panels, I no longer suffer so much with XCode responsiveness, but there is still some lag that can be clearly felt.
Check that there is not heavy coding on ViewWillDisappear.
Also if you have NSURLConnection or any other having delegate methods should not get called while switching tabs.

XCode 3.2.6 hangs up

My Xcode 3.2.6 is hanging up constantly.
While I'm coding with no apparent reason it starts consuming more and more CPU, CPU temperature rises up to 80 celsius, the fan get exhausted and I'm forced to "force-quit" it and relaunch it to be able to continue working...
It start happening this week and nobody else on my project is having the same troubles.
My OS is Snow leopard 10.6.8
Any ideas on what could be happening?
I had the same exact issue with my Xcode 3.2.6 project... Would start out using one core and if I let it sit, would use all 8 cores of my i7 MBP. Very frustrating having to restart Xcode every 5 minutes.
My issue actually was resolved when I removed an iPhone from the Organizer that was running iOS 5.0.1. Xcode was trying to get information from the iPhone, and wasn't able to, since the iOS SDK requires Xcode 4.x
I also removed all the user settings from within the project's *.xcodeproj package as well; not sure if that had additional effect. removing those without removing the iPhone had no effect, though.
Have you tried doing a "clean" on the target? Have you tried checking your disk with Disk Utility?

How to disable indexing in Xcode 4?

Not a long time ago I updated Xcode to version 4. This new version spent a lot of time on indexing the project (it's quite large). That's why I would like to disable indexing. Searching through Xcode help and internet gave no results.
Open a terminal window and paste this command:
defaults write com.apple.dt.XCode IDEIndexDisable 1
You'll lose some features (autocomplete, jump to definition, some of the assistants won't work right). But you'll gain back ram and cpu.
For my project Xcode went from using 2 Gigs to a few hundred MB. (which I sorely needed to compile with ;))
Reducing the priority of the XCode process helps:
renice 10 -p PID
You can get the PID from the Activity Monitor or top/ps commands.
This problem has been noticed on this newsgroup:
The crux of it seems to be that XCode4 uses crazy amounts of ram during indexing - like, 5gb or so(!), and thus if you're on a machine with something like 12gb, there's no problem, but if you're on a laptop with only 2gb or so, you'll have some pretty severe paging going on.
I'm guessing apple's internal engineers were all rocking maxed-out mac pros or something.
I ran into either the same problem or something similar. My project includes heavily templated C++. Including those headers in the PCH file solved the problem for me.
My new retina Macbook pro running XCode 4 was extremely slow doing indexing (and everything else). My Mac mini at home was very fast working on the same project!? Turns out it was my anti-virus software - doing a scan of every file read or written on the MacBook. Turning that off sped everything up by a ton.
Slow indexing is not a given. And more memory isn't necessarily better.
I have a medium sized project for work ~ 500 source files. After deleting the derived data, it takes 18 minutes to finish reindexing this project. That's with no other apps open and not doing anything else with the computer. This is on a fairly recent Macbook Pro with 8G of memory and an i7. Horrible, right?
My home machine is a recent Mac Mini with 4G of memory and an i5. On that machine the exact same project takes 40 seconds to completely index.
I don't yet know what the difference is, but I'm working on it.
It's not possible to disable indexing in Xcode 4. Many of the IDE's features are built on top of the index it maintains.

Resources