XCode swallowing all memory

Lately, XCode's use of memory has resulted in freezing my machine. This tends to occure during compilation, but not only. No such problems from command line or alternative IDE CodebBlocks with same compiler. Any suggestion for troubleshooting?


Developer Information:

Version: 3.2 (10M2309)
Location: /Developer
Applications:
Xcode: 3.2.4 (1708)
Interface Builder: 3.2.4 (804)
Instruments: 2.7 (3014)
Dashcode: 3.0.2 (333)
SDKs:
Mac OS X:
10.5: (9L31a)
10.6: (10M2309)


Activity Monitor for XCode:

Real 2.51GB
Virtual 15GB
Shared 49MB
Private 2.79GB
Virual Private 4.74

MacBook5,1, Mac OS X (10.6.1)

Posted on Mar 3, 2011 1:19 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 4, 2011 2:32 PM

Hi frangipane

frangipane wrote:
"If I were in your position, I would clear out all cache files,"

Specifically, you mean ~/Library/Caches/com.apple.Xcode? FYI 82KB.


You might as well clear out ALL cache files. It won't do any harm and can reclaim some disk space. More information here:
http://hints.macworld.com/article.php?story=20060111202501460

Be sure to reboot immediately after the files have been deleted.

"then delete Xcode preference files,"

Where are they?


Now I look, I see it's just one file:
~/Library/Preferences/com.apple.Xcode.plist

"then run the developer tools de-install script. "

- Where is it?


/Developer/Library/uninstall-devtools

This is Unix command script so you might prefer to execute it from the Terminal program with these commands:
cd /Developer/Library/
./uninstall-devtools

- Wouldn't a de-install script be responsible for the above tasks?!


No. Most uninstallers never bother deleting cache files, and they tend to leave preference files alone so they're still there if the application is re-installed. In this instance, it's quite possible that the cache files and/or the preference files are corrupted so we want to get rid of them just in case.

Good luck

Bob
27 replies

Mar 25, 2011 4:39 AM in response to Bob Lang1

Having the same issue here, my machine doesn't freeze but starts to be slow and "laggy" in any task.
I followed ure above instructions with no success, still the same problem.
By now im writing this post with xCode 4 (64bit) running and with an open project (~2MB source code) and from what i can see using "Activity Monitor" it's using 2,31 GB.

Those are the specs of my Mac Mini ( unibody 2010 )
P8600 Intel processor 2.4Ghz
2 GB DDR3 1066Mhz

I really cannot understand how an application like xCode could use all that Ram...

Any help or suggestion would be really appreciated

Apr 5, 2011 3:47 AM in response to K T

KT ure a genius, it's just like to say that my car uses too much gas to run and ure responding just to buy more gas. C'mon seriously, i've no money to waste in unuseful ram or time to waste readin' this kind of things. If u wanna talk on how much useful is ram in a von Neumann machine than you came in the wrong place, here we're talking about an application bug, try on answers.yahoo.com.
Please
Any kind of technical and useful answer will be really appreciated!

Message was edited by: 0xDEADBEAF

Nov 21, 2011 1:12 PM in response to abqowen

Same here, using XCode 4.2.


I have a late 2011 iMac and recently upgraded from 4GB RAM to 16GB to stop the annoying swapping that starts after some hours of use.


After reboot, about 3GB is used, only using XCode and Safari. Using only those programs, 10GB is used after one day of use and contually increasing. I then exit XCode and then only about 3GB is used again.


Note also that the memory usage reported by the Activity Monitor for XCode is low even if all memory is used up by XCode.


Apple, what about using Instruments on XCode to find your own memory leaks?

Jul 27, 2012 7:47 AM in response to frangipane

OK it's been while no one has said anything. You all solved it or gave up!?


MBPR with 16G, Mountain Lion, and Xcode 4.4. Same problem here with one project after an hour only 400 MB is left!!! And funny that I do nothing except watching Storyboard. I'm creating document now from project so all I am is in storyboard scrolling. No running, no debugging. and no nothing. Just watching.


It seems no matter how much you have memory it eats up all of it. And with 60 UIViewCntroller in the page is so slow and buggy to scroll around.


I hope I can find something after all.

Mar 17, 2013 2:26 AM in response to frangipane

I think I have the same problem, although mine is significantly more pronounced! I'm running a Mac mini 2012 with 8GB of ram and all the latest updates (as of yesterday).

Every time I click on a (any) view controller, or even worse try to edit the dimensions of anything within the view controller, my 8GB of memory collapses to about 6MB~ in under a minute. If I then stay with the view controller selected in about 5 minutes the swap used can be around 20GB.

This issue has basically rendered my interface builder useless, as I don't get the same memory leak when editing raw code.


Does anybody have any fix suggestions?

Sep 18, 2011 5:52 AM in response to frangipane

I'm with frangipane - my machine is thrashing unusably, and it might as well have frozen.


I have a 5-year old iMac with 2Gb of RAM. It ran Snow Leopard and Xcode 3 quite well.


Very recently I shifted to Lion (the machine has a Core 2 Duo) and Xcode 4. So far I have only compiled "Hello World" type programs, as I'm trying to learn the new layout and settings. I very soon find that I have about 600 Mbytes of "inactive" memory and almost no free memory. If I try to do anything the disk drive whirrs, and I get a lot of swapping - it seems that the "inactive" memory isn't being given back. It got so bad that I eventually force-quit Xcode, and even then the machine took a while to react and stop frantically swapping.


I have tried the purge command in a terminal. It has helped. But I'd much rather have the "inactive" memory given back freely. Is there any way of disabling the "inactive memory" mechanism?


I was going to buy a new machine fairly soon anyway, but I'm annoyed that the software upgrade has changed my current machine from being useful to being quite useless for development.

Jul 28, 2012 12:24 AM in response to Maziyar

When I first posted on this, I had an older machine with 2 gigabytes of memory, which was fine for Xcode 3, but not Xcode 4. I now have an 8 GB machine. At first I still had a lot of problems, but with Xcode 4.3.2 the problem seemed to be much better for me. Xcode still uses a lot of memory, but doesn't gobble it all up in the same way that it used to. I am doing development for Mac OS, not iOS, and I haven't gone to Xcode 4.4 yet.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

XCode swallowing all memory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.