Hi,

thank you for your answer, I really appreciate that :) However, my question 
appeared right after I've read the article you mentioned. It doesn't state, 
that Android can "kill" a SERVICE, even if its host PROCESS has 
"background" priority. It states, that Android kills entire PROCESS, based 
on its priority.
>From my point of view, under memory pressure you have to act quickly. How 
much memory is it possible to free in case you stop a SERVICE? Nobody 
knows. In theory you can calculate retained size of an object, but in this 
case you have to rely on GC. When garbage collection will happen? Again, 
depends on GC. On the other hand, OS knows each process memory footprint. 
OS has their priorities. OS has enough information to act quickly and be 
effective under memory pressure.
I can be wrong, but for me it doesn't make sense to "kill" a SERVICE 
without killing entire PROCESS. Yes, user can do this manually, but it 
doesn't mean Android does that. Again, I can be wrong. But I really need 
some proofs :)

Thank you,
Alex


On Friday, December 5, 2014 4:12:21 AM UTC+1, TreKing wrote:
>
>
> On Tue, Nov 25, 2014 at 5:08 AM, Oleksii Bieliaiev <abel.th...@gmail.com 
> <javascript:>> wrote:
>
>> My question is, whether is it possible, under certain conditions (low 
>> memory, timeout, etc), that Android "kills" our started service separately, 
>> without killing entire process?
>
>
> Yes, it's possible. If the process does not have a foreground UI element 
> (an Activity the user is using or an ongoing notification created with 
> startForeground) the Service is considered to be "background" and more 
> susceptible to being killed.
>
> See: 
> http://developer.android.com/guide/topics/processes/process-lifecycle.html
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago 
> transit tracking app for Android-powered devices
>  

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to