Re: Build slowdown with 4 processors vs. 2 or 1?
Re: Build slowdown with 4 processors vs. 2 or 1?
- Subject: Re: Build slowdown with 4 processors vs. 2 or 1?
- From: Jim Wintermyre <email@hidden>
- Date: Fri, 30 Mar 2007 22:39:58 -0500
Title: Re: Build slowdown with 4 processors vs. 2 or
1?
At 10:39 PM -0800 12/7/06, Chris Espinosa wrote:
On Dec 7, 2006, at 9:47 PM, Jim
Wintermyre wrote:
Here's a weird
one. In one of my projects, when I build in XCode on the Mac
Pro, it grinds to a halt after 4 files. There is a flurry of
disk activity, and hardly any CPU activity. Top seems to
indicate a lot of swapping going on. This goes on for around a
couple minutes. What's weird is that if I set the number of processors
to 2 or 1, the problem goes away. The entire project builds in
less than 20 seconds, and the CPU load is pegged pretty much the
entire time, which is what I'd expect. Any ideas what could be
going on here? Any settings I could tweak?
We see this sometimes with processor
scaling in Mac OS X. gcc maps in the precompiled header into
each process as a private write file, then writes to it, forcing the
kernel to do a copy-on-write operation each time. If you have 4
copies of gcc running simultaneously all mapping in the same
precompiled header file and trying to write to private copies of it,
the kernel can get saturated with the copy-on-write
requests.
So after all that work to get your
precompiled headers coherent, you may be amazed to find that that's
the cause of the slowdown when scaling up to more processors.
Sorry. It requires kernel work, which is happening now.
For now you can cut back to 2 processors or make gratuitous
differences in your precompiled headers :-), or use distributed
builds.
Digging this one up from the past to post an update. The
Mac Pro I was using had 2 GB of RAM. I added another gig of RAM,
and this problem went away.
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden