Xcode stops running when I don't watch it for a while. What's wrong?
This may be the built in "undocumented" to non-developers feature of Lion called Automatic Termination that is causing Xcode to quit when you don't want it to.

As noted in "Lion Is a Quitter"


  Lion will quit your running applications behind your back if it decides it needs the resources, and if you don’t appear to be using them. The heuristic for determining whether an application is “in use” is very conservative: it must not be the active application, it must have no visible, non-minimized windows — and, of course, it must explicitly support Automatic Termination.