title: Crashed service restarted after a very long time
body: <p>I am running a service in the foreground. Sometimes it is terminated, presumably for memory reasons (although I'm not 100% sure of that from the LogCat log). Other services that are terminated are scheduled for a restart in 5000ms, but looking at the log, the restarts of my service are very long, for example:</p>
  
  <pre><code>11-15 15:39:48.756: W/ActivityManager(375): Scheduling restart of crashed service com.example.app/com.example.SensorService in 1019562ms
  </code></pre>
  
  <p>What could account for this? How is the restart interval set? I have seen some suggestions that services with notifications are restarted with a shorter delay, but my service does have a notification.</p>