[guardian-dev] developer sneak peak: CacheWord
G. Blake Meike
blake.meike at gmail.com
Wed Mar 27 13:59:19 EDT 2013
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.
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:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQEcBAEBAgAGBQJRUweVAAoJEBEET9GfxSfMsR0IAJqG9AqqeyqkFhMzZDRR1bT/
> jeNZivlgBCqbMWbcVaUn0xJA3+/R4tesT3hDzxuWFPrGDHK6wTiXTYKNIQRs/ycD
> xcVCje+gyFi+7t1QSxaeQYyBFx4lwtgLnl2oru2YXddcJ2s7hNHVgChNume/Hosd
> wkQYZggV2vovMDPauOyj9AoPyfoZItj7nP8BmyRzdSRfDtg4klxW/MEUynxHt87Q
> jDDmmvb8mESARVaaDys/kuxbSj1Sd/0gOB9FZ5krJwil9LAKQQ97Th5Mu46fDY2o
> 9aGYhDsS8ZPxyURy3ZtbQ1OpMX7Xv3djNGBWs8/iE1hWm28VHt6NMwIUEPWNjfM=
> =4/dg
> -----END PGP SIGNATURE-----
> _______________________________________________
> 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
More information about the Guardian-dev
mailing list