No cap, as this is a random occurance. However it does seem to happen when the cap is over a couple of meg in size. It begins to compile yet fails, leaving a broken exe. A number of attempts are required to make it work.
Seems to happen less (but doesn't fix the problem) by keeping construct the active window for a few seconds after it's done compiling) but as I say, this doesn't really fix anything and is probably up there with garlic keeping vampires away as a viable solution.