0

I would like to ask if there is something like intent overflow when

WakefulIntentService.sendWakefulWork()

or in general

IntentService.startService()

is called very often not waiting for previous jobs to be finished. I am thinking of a situation that due to user's input it might happen that the job takes 1 minute but it is called every 10 seconds. Should I implement any mechanism to protect from starting too many jobs? Thanks for all answers

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
bart
  • 2,378
  • 2
  • 19
  • 21

1 Answers1

0

Should I implement any mechanism to protect from starting too many jobs?

If you anticipate frequent stretches where your added jobs exceed the processed jobs, you should consider doing something to help manage that. While I am not aware of a hard exception before OutOfMemoryError -- which, unless you have some pretty big Intent extras, is rather unlikely here -- your IntentService will just keep running and running and running. Along the way, it will be chewing up CPU, RAM, possibly bandwidth (depending on what the work is), and hence battery life.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491