Explain the lifecycle of a foreground service and how you handle system-initiated process death in resource-constrained environments.