[guardian-dev] developer sneak peak: CacheWord

Abel Luck abel at guardianproject.info
Sat Mar 30 13:12:27 EDT 2013


G. Blake Meike:
> Hi.  I just stumbled into this discussion.  This may be of use:
> 
> Android does, in fact SIGKILL processes by priority.  Priorities are values between 15 and -16, smaller is more persistent.  You can find the priority of any given process by looking at the file /proc/<process id>/oom_adj.
> 

Does Android SIGKILL or SIGTERM, there is an important difference.

Follow up question:

Does Android ALWAYS SIG[TERM,KILL]? If not, when does it do the other?

~abel

> It is the process that is being killed, not the DVM. Native code is no help.
> 
> Android can kill off any process in an attempt to free memory.  Each device has a build-time table that associates memory conditions with the priorities that should be killed in those conditions.  It is unlikely that things with oom_adm < 0 will ever be killed.  It is also difficult to get an oom_adj < 0 unless your app is signed with the same key as Android itself.
> 
> The discussion below concerns the use of the android:persistent flag.  Karim claims that the flag may work for any app.  I have only a little familiarity with the flag: I don't know if it affects priority.  I do know that if a persistent app is killed off, it will restart automagically.
> 
> https://groups.google.com/forum/?fromgroups=#!topic/android-platform/nU0e3aoBlSY
> 
> -blake
> 
> On Mar 27, 2013, at 7:52 AM, Michael Rogers wrote:
> 
> On 26/03/13 18:10, Hans-Christoph Steiner wrote:
>>>> But my guess is that if Android kills a process without even
>>>> calling onDestroy(), then its probably sending SIGKILL, and then
>>>> native code won't help.  In that case, sounds like the permanent
>>>> notification is required to guarantee that the zeroification will
>>>> be run.
> 
> Even a process that's showing a permanent notification may be killed
> if there's not enough memory to keep all such processes running.
> 
> https://developer.android.com/guide/components/processes-and-threads.html#Lifecycle
> 
> Cheers,
> Michael
> 
> 
>> _______________________________________________
>> Guardian-dev mailing list
>>
>> Post: Guardian-dev at lists.mayfirst.org
>> List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev
>>
>> To Unsubscribe
>>        Send email to:  Guardian-dev-unsubscribe at lists.mayfirst.org
>>        Or visit: https://lists.mayfirst.org/mailman/options/guardian-dev/blake.meike%40gmail.com
>>
>> You are subscribed as: blake.meike at gmail.com
> 
> _______________________________________________
> Guardian-dev mailing list
> 
> Post: Guardian-dev at lists.mayfirst.org
> List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev
> 
> To Unsubscribe
>         Send email to:  Guardian-dev-unsubscribe at lists.mayfirst.org
>         Or visit: https://lists.mayfirst.org/mailman/options/guardian-dev/abel%40guardianproject.info
> 
> You are subscribed as: abel at guardianproject.info
> 



More information about the Guardian-dev mailing list