Android service killed -


I have a service running in the same procedure as my process.

Sometimes the Android OS decides to beat my service (possibly due to low memory).

My question is: Is my application being killed with service? Or how does this work exactly?

Thank you!

Be sure to read first:

The key to this is that on Android A process is just a container for code - or especially one or more components (activities, services, receivers, providers). By default all components get their own dedicated process in .apk, all of which run together. It is almost always the way you want it.

When the user is interacting directly with the components of that process (which is an activity), then Android will work very hard to run this process, and you will not see it except for extraordinary circumstances. Killed.

When the user is no longer directly interacting with the process, then this expense is worth compared to the other processes described in the referenced documentation. That is, empty procedures (not an interesting component) will kill those processes before the user, who will kill before proceeding because of the services. Therefore running the ongoing service will keep your process at the expense of other procedures.

At the same time, we will have to deal well with more and more applications by running the services, often indefinitely, and often with a memory leak, a service runs faster for a long time, Android Less and less effort will be made to keep its process running efficiently, meaning it will go down in the background background until the memory takes away from the killer. After that, if the service still wants to run, a new process will be restarted for it.

The result is that for general services, which have been running for a long time, it is expected behavior that will kill their process a little later. There is no need to stop this service; The service that wants to continue to operate will do so, it will only need to be made immediately in a new process.

Of course, as long as the user is interacting with any activity in your process, it will be killed, because it is dragged into the foreground, regardless of what is going on with any of its services.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -