Reputation: 20431
Running XCode and the iPhone Simulator can cause my free memory to drop from 1.5GB to 150MB, and at times 15MB, reducing the whole machine to a crawl. It appears that it is allocating Active Memory. Is there any way to optimise the Run sequence in Xcode to perform quicker and eat up less memory? Or in general, what would be a good way to reduce the memory footprint of using the Simulator regularly? It seems the longer I use it the slower it becomes, even when it's all I'm running.
Upvotes: 2
Views: 915
Reputation: 254
It's the same case with me. I inspected it with Instruments and was surprised to find out that Xcode allocated more than 4 GB RAM in less than 2 hours. But the actual memory usage of Xcode at any given time was never more than 500 MB. This means that there is some bug with Garbage Collection. Also, it seems that the memory allocations increase quite frantically when you edit a xib/nib.
Unfortunately, the only workarounds right now are to relaunch Xcode every couple of hours and try to avoid nibs (create views in code). Also, if you let Xcode sit idle for a while, the GC kicks in and lot of active memory is freed.
Upvotes: 1