Shared precompiled headers are identified by the name of the prefix file and a hash of critical build settings. If all match, an existing shared one is used; if there's any difference, then a new one is created. Cleaning uses the same algorithm.
So what can happen is you:
- build
- change settings
- clean including precompiled headers
And there's now no match for the precompiled header, so the one that you used for the last build is not cleaned. Sometimes this is desired behavior; that may be a header shared by another project (perhaps one that isn't open right now).
If you want to ensure that precomps are removed, make sure to Clean (Removing Precomps) before changing any build settings or your prefix name.
The precomp cache is capped at 1Gb, and on each Xcode launch it clears out older headers so that the cache doesn't grow without bounds. There's an Expert Preference you can use to control the cache size. And you can always delete it manually from your /Library/Caches folder.
Chris